Programming Fundamentals: ========================= 1) Keywords: ============ ==> also called as "Reserved words" or "built-in" words. have a pre-defined meaning ==> 66-keywords ==> Keywords are always write/use in lower case only. 2) Identifiers: =============== ==> to name any entity/element of the program in JavaScript, we need an Identifier. Identifier Rules/Naming Conventions: ===================================== 1) Identifier should include with: Alphabets (Upper-case/Lower-case/Any Case) Digits (0 to 9) Two Special characters: Underscore sign ==> _ Dollar Sign ==> $ Ex: a = 10 a_23 = 12.23 a.c = 123 ==> Invalid 2) Identifier never start with digit but can allowed to start other than the digit. ex: 97rk = 123 ==> error rk97 = 1.23 _97rk = 0.009 $rk_12 = 123 3) No other symbols are allowed in identifier. 4) No keywords of JS can use as an Identifier. 5) JS is Case Sensitive Programming Language. 6) Ecommerce Application ==> XYZ ltd specification book a = 112; // b#c = 221; $97rk = 1122 a97 = 121; // if = 123; If = 123; IF = 1.23; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 100 console.log(a); // console.log(b#c) console.log($97rk); console.log(a97); console.log(If); console.log(IF); console.log(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); ============================================================== Variables: ========== ==> is a named memory or a container can be used to store values a = 10 a = 100 a = 200 ==> In JavaScript, the variable can be defined in different ways: using "var" keyword =================== Syntax: var identifier = value; console.log(a); // due to the hoisting, we can access the variable with var keyword before the declaration. var a; // initialization console.log(a); console.log(c); { var a = 10;//block variables/Local Variables var b = 20; var c = a + b; console.log(c); // Local variable/Block variable can be with "var" keyword can able to access within the same block and outside of the block also. } console.log(c); { console.log(c); // if the variable with "var" keyword, we can access the variable of one block in another block. }