console.log put into function