Monday, February 25, 2019

Variable




// declaring one javascript variable
var firstName;

// declaring multiple javascript variables
var firstName, lastName;

// declaring and assigning one javascript variable
var firstName = 'Homer';

// declaring and assigning multiple javascript variables
var firstName = 'Homer', lastName = 'Simpson';

//instant result
var firstName = prompt("What's your first name?", "");
document.write(firstName);

No comments:

Post a Comment

Sum Total Integer

Total sum Total sum var value = 2568,     sum = value         .toString()         .split('')         .map(Number)         ...