JavaScript complete Course by Cyber Sushant. Learn JavaScript for free. Cyber Sushant brings you a crash for JavaScript.
Introduction To Programming
PROGRAMMING IS A WAY TO TALK TO COMPUTERS. A LANGUAGE LIKE HINDI, ENGLISH, OR BENGALI CAN BE USED BY A HUMAN BUT FOR COMPUTERS. WE NEED STRAIGHT INSTRUCTION
PROGRAMMING IS THE ACT OF CONSTRUCTING A PROGRAMMING, A SET OF PRECIOUS INSTRUCTIONS TELLING A COMPUTER WHAT TO DO
WHAT IS ECMASCRIPT?
ECMA SCRIPT IS A STANDARD ON WHICH JAVASCRIPT IS BASED! IT WAS CREATED TO ENSURE THAT DIFFERENT DOCUMENTS ON JAVASCRIPT ARE ACTUALLY TALKING ABOUT THE SAME LANGUAGE
CHAPTER 1
JUST LIKE WE FOLLOW SOME RULES WHILE SPEAKING ENGLISH, WE HAVE SOME RULES TO FOLLOW WHILE WRITING A JS PROGRAMMING PROGRAM. THE SET OF THESE RULES IS CALLED SYNTAX IN JAVASCRIPT.
1) WHAT IS A VARIABLE?
A VARIABLE IS A CONTAINER THAT STORES A VALUE. THIS IS VERY SIMILAR TO THE CONTAINER USED TO STORE RICE, WATER, AND OATS.
THE VALUE OF A JAVASCRIPT VARIABLE CAN BE CHANGED DURING THE EXECUTION OF A PROGRAMMING
* * * RULES FOR CHOOSING VARIABLE NAME:-
1)LETTERS, DIGITS, UNDERSCORE, $SIGN allowed
2)MUST BEGIN WITH A $, - OR A LETTER
3)JAVASCRIPT RESERVED WORDS CAN NOT BE USED AS A VARIABLE NAME
4)SUSHANT AND Sushant BOTH ARE DIFFERENT (IT IS CASE SENSITIVE).
2) Var AND Let IN JAVASCRIPT:-
- VAR IS GLOBALLY SCOPED WHILE LET & CONST ARE BLOCKS SCOPED2
- VAR CAN UPDATE & RE-DECLARE WITHIN ITS SCOPE
- LET CAN BE UPDATED BUT NOT RE-DECLARE
- CONST CAN NEITHER BE UPDATED NOR BE RE-DECLARED
- VAR VARIABLES ARE INITIALISED WITH UNDERLINED WHEREAS LET AND CONST VARIABLES ARE NOT INITIALISED.
- CONST MUST BE INITIALISED DURING DECLARING, UNLIKE LET AND VAR.
3) PRIMITIVE DATA TYPES & OBJECTS:-
1=> PRIMITIVE DATA TYPES ARE A SET OF BASIC DATA TYPES IN JAVASCRIPT
2=> OBJECTS IS A NON PRIMITIVE DATATYPE IN JAVASCRIPT
*** THESE ARE THE 7 PRIMITIVE DATATYPE ***
1)NULL
2)NUMBER
3)STRINGS
4)SYMBOL
5)UNDERLINED
6)BOLLEN
7)BIGINT
*** OBJECTS(non-primitive):-
AN OBJECT IN JAVASCRIPT CAN BE CREATED AS FOLLOW:-
CONST ITEM ={
PRICE :"50"
KEY NAME: "LET BUILD "
}
****DATA TYPE IN JAVASCRIPT ***
let a = 354; //This is number datatype
let b = null; // This is null datatype
let c = true; // This is bullen datatype
let d = BigInt("56"); //This is bigint datatype
let c = "I am Sushant"; //This is string datatype
let d = "style"; //This is style datatype
0 Comments