Last active
September 4, 2019 15:49
-
-
Save rintoandrews90/ba960cabe11e619f00da4cf1e8f7c1ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******* | |
* 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