Skip to content

Instantly share code, notes, and snippets.

@rintoandrews90
Last active September 4, 2019 15:49
Show Gist options
  • Save rintoandrews90/ba960cabe11e619f00da4cf1e8f7c1ae to your computer and use it in GitHub Desktop.
Save rintoandrews90/ba960cabe11e619f00da4cf1e8f7c1ae to your computer and use it in GitHub Desktop.
/*******
* Variable Mutation & Coercion
* To mutate a variable once it has been defined means to alter its value.
*/
var firstname = 'john';
console.log(firstname);
//1.String Type
var lastname = 'smith';
//2.Number Type
var age = 28;
console.log(age);
//vaibale mution
age = 'rinto'
console.log(age);
var job;
job = 'teacher';
//type varibale coercion
consloe.log(fistname + lastname + 'age ' + age + teacher);
alert(fistname + lastname + 'age ' + age + teacher);
var lastname = prompt('enter your name');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment