JAVASCRIPT JOURNEY - DAY 3

#teamtanayejschallenge

CHAPTER 3 : PROGRAM STRUCTURE (JS SKELETON)

images.jpg

JavaScript is simply written in plain text.

The Program Structure of JS depends upon:

Statements and expressions :

Code that can be evaluated to a value is an expression. Since expressions produce values, they can appear anywhere in a program .

'hello';
'hello' + 'world';
23;            
true;         
sum;          
this;

whereas A statement is an instruction to perform a specific action. Such actions include creating a variable or a function, looping through an array of elements, evaluating code based on a specific condition etc.

BINDING:

How does JS remember things?

DOES JS HAS SOME SUPER-POWER??

JS produce new values from old values, but this does not change the old values, and the new value has to be immediately used.

To catch and hold values, JavaScript provides a thing called a binding(variable).

The bindings include let.const and var. Which were dicussed earlier in Day 3.

Just it is another name for them . For you to not get confused .

Bindings as tentacles(something to hold), rather than boxes. They do not contain values; they grasp them—two bindings can refer to the same value.

A program can access only the values that it still has a reference to. And this can be achieved through let, var and const.

Other than this , Functions , Return Values , Loops provides a constant support to the program structure of JS .

Later everything will be discussed in detail wrt Program Structure.

Thankyou! Happy Learning-)