Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

what is the difference between console.log and return

/* this is a function that return the square of the argument */
var square = function(x) {
  return x * x;
}
/* we want to log in the console the value of x+(x*x)
var x = 7;
console.log(x + square(x));
/* should log 7+(7*7) => 7+49 => 56 in the console
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to create a point in js 
Javascript :: angular array export to excel 
Javascript :: react navigation hide header 
Javascript :: destructuring assignment 
Javascript :: js download file from webserver 
Javascript :: array from string js 
Javascript :: this is javascript 
Javascript :: javascript simple hash 
Javascript :: mongoose get id after save 
Javascript :: two object combine together javascript 
Javascript :: dynamic set required in angular using formcontrol 
Javascript :: npm ERR! code E405 npm ERR! 405 Method Not Allowed - GET https://registry.npmjs.org/ 
Javascript :: variables in js 
Javascript :: how to add a variable in js 
Javascript :: select child element javascript 
Javascript :: js object without prototype 
Javascript :: does pycharm support javascript 
Javascript :: export default 
Javascript :: background colour in react 
Javascript :: jwt strategy 
Javascript :: how to practice javascript 
Javascript :: scrollout js 
Javascript :: how to set button width in javascript 
Javascript :: javascript download image 
Javascript :: javascript parseint 
Javascript :: expression vs statement javascript 
Javascript :: nodejs postgresql local connection 
Javascript :: javascript open window 
Javascript :: javascript for...of with Strings 
Javascript :: d3 paning 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =