Some Shocking facts About JavaScript π»β
Roshan Shambharkar
Posted on October 22, 2022
fact 1. JavaScript Was Originally named mocha, But after some time it is used to called Live Script and some period of time people start calling javascript.
Fact 2. JavaScript Was created in 10 Days.
Fact 3. Function can call Themselves, In javaScript function call themselves
for e.g
(function() {
console.log("I am a function");
})(); // I am a function
Wrap Function between () and immediately call it with empty bracket (). they called as IIFE it means Immediately Invoked Function Expression
Facts 4. ; In JavaScript You can write a Program Using semicolon;
In JavaScript, You can use semicolon in the startas well as at the end of the statement but it is not recommended but you can use it try it and let me know in comments section
Fact 5. Undefined is not a reserved
Undefined is not reserved word in javascript, because it has very special meaning and by using undefined you can determine a variable is undefined it is only way to defined variable is undefined and you can use it as identifier.
var undefined = "I am undefined";
console.log(undefined);
//I am undefined
Posted on October 22, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.