History of JavaScript
History of JavaScript
Dynamically Typed Languages: Types are checked at runtime, meaning a variable can
change its type as the program runs.
Examples: Python, JavaScript, Ruby.
Nominal Typing: Focuses on the "name" or label of the type. If two types have
different names, they are treated as different.
Structural Typing: Focuses on the "structure" of types. If two types have the same
structure, they are treated as the same.
Duck Typing: Focuses on behavior. If something behaves the way you expect, you can
use it, regardless of what it’s called.
scope variables:
1.global variable = is applicable for all the everywhere in the code.
2.local variable = is applicable for only within a block like function,etc..
a. function scope:
Variables declared inside a function can only be used within that
function.
b .block scope :
Variables declared using let or const inside {} (blocks like if, for, etc.)
are limited to that block.
----impotant is var is both everywhere in block scope is allowed but let and cons
are limited which means .these are used in function,if,etc.. within only ---------