Enhance your career prospects with our Data Science TrainingKNOW MORE
Embark on a Data Science career with our Data Analyst BootcampKNOW MORE
Elevate your Data Science career with our AI Engineer BootcampKNOW MORE
Work on real-world projects, build practical developer skillsKNOW MORE
Hands-on, work experience-based learningKNOW MORE
Start building in-demand tech skillsKNOW MORE
But none of them tells whether a variable is a Number, string or Boolean. Whatever we assign to the variable, its type becomes that.
A boolean represents only one of two values: true, or false. Think of a boolean as an on/off or a yes/no switch.
var boo1 = true; var boo2 = false;
var num1 = 32; var num2 = +Infinity; console.log(num1); //32 console.log(num2); //Infinity console.log(Number.MAX_VALUE); //1.7976931348623157e+308 console.log(Number.MIN_VALUE); //5e-324 console.log("abc"/2); //NaN
Strings are used for storing text. Strings must be inside of either double(") or single(') quotes. Most recently in ES6 a new quotes was introduced and it’s with tilde(`).
var str1 = 'hello, it is me'; var str2 = "hello, it's me"; var str3 = `hello, it’s me`;
Null has one value: null. It is explicitly nothing. It is useful in JS programming to sometime assign a variable null value.
var nothing = null;
A variable that has no value is undefined. When we first declare a variable as in the statements below, the value of undefined is assigned by the JS compiler.
var testVar; console.log(testVar); // undefined testVar = 3; console.log(testVar); // 3
Symbols are the new primitive data-type introduced in ES6. Symbols are unique an immutable data-type. They are tokens that can be used as unique ids.
Two Symbols are never the same, even if they are declared as same. Consider the below example.
let symbol1 = Symbol(); let symbol2 = Symbol(); console.log(symbol1 === symbol2); //Output - false
Your email address will not be published. Required fields are marked *
Build various types of web applications,command-line application,etc....
Introduction: Angular (What is Angular?)Angular was formerly introdu...
Get a 1:1 Mentorship call with our Career AdvisorBook your free session today Book your free session today
Get a 1:1 Mentorship call with our Career Advisor
Thanks for sharing the information, it is very helpful, I hope to get more such beautiful blogs from you.
You have shared great information with me i appreciate your work!