This means when You use your
CapsLock keys it really matters. Unlike in HTML and CSS Where you can use UPPER and lowercase letters, But in JS the casing of the words matters.
var greenDuck ="This Duck is Green"; console.log(greenduck);
Above code will show an error
Uncaught ReferenceError: greenduck is not defined.
practice of writing phrases such that each word or abbreviation in the middle of the phrase begins with a capital letter, with no intervening spaces or punctuation. Common examples include "iPhone" and "eBay".
//variable starts with a Lowercase letter var greenDuck; //objects and classes start with UpperCase letter var date = new Date(); //Constants are All-Caps const NAME;
//With whiteSpaces(human readable) var date = new Date(); document.body.innerHTML = "<h1>" + date + "</h1>"; //without whiteSpaces (machine Readable difficult for humans) var date=new Date();document.body.innerHTML="<h1>"+date+"</h1>";
- Semicolon is just a matter of opinion
Do What Works best for you
// A single line comment starts with two slashes. /* A multi-line comment starts with a slash and an asterisk and ends with an asterisk and a slash */