//datatypes are based on memory allocation Primitive datatypes-> call by value (string,number,boolean,null,undefined,BigInt,symbol) ->Stack memory Reference/Non primitive data types -> call by reference ( array,object, function) -> heap memory JavaScript is a dynamically typed language. This means that you don't need to specify the data type of a variable when you declare it.
There are 2 types of datatype 1. Primitive datatype:- 1.String 2. Number 3. Boolean (true / false) 4. null (iska matlab hai empty or zero nahi hai) 5. undefined (aapne variable declare kardiya hai but usmein aap kya value dalenge aapne decide nahi kiya hai) 6. Symbol (kisi bhi value ko unique banane ke liye use kiya jata hai) 7. BigInt (jo badi values hoti hai oo hum BigInt mein use karte hai) 2. Preference datatype (Non Primitive datatype) 1. Array ( [ ] ) 2. Object ( { } ) 3. Function ( function( ){ } )
CLEARLY UNDERSTANDABLE PLAYLIST MAJA AA GAYA SIR ITNA ARRAM SE THO SIRF APP HI COURSE COVER KAR SAKTE HOO ....THANKU YOU ARE A VERY GOOD TEACHER APPRECIATE YOUR TEACHING STYLE EASY WAY MAI THANKU JIII😀😇😇😇
Thank you for making such a beautiful javascript tutorial. Because You teach the actual javascript which is necessary for actual production development need. Very Very thank you. I will share your channel as much as possible to everyone. I really like your teaching style and I aslo need that type of javascript teacher. God bless you.
Primitive Types: 1. Stored in stack. 2. Passed or assigned by value (call by value). 3. Changes to copies don't affect the original. Reference Types: 1. Stored in heap; accessed via references (stored in stack). 2. Changing the value through another reference affects the original.
"Hey Chai or Code and Hitesh Choudhary, I'm on the edge of my seat in anticipation for the backend full series and DSA series on this channel! ☕💻 Your content is like the perfect blend of coding wisdom and the soothing essence of chai, and I can't wait to dive deep into these topics with your expert guidance. Keep brewing up those fantastic tutorials, and I'll keep sipping and coding along! 🚀🔥"
sir mene ye concept phle bhi padha hai but smj nhi aya tha. Complex krke padhya tha teacher nai but apne bhot easy way mai explain krdiya stack and heap
hey hitesh, i am from Pakistan, and I had A lot of confusing regarding this concept I tried hard to understand it by chatGPT and also with other RU-vid videos, but I was unable to understand this concept, thank you so much,
Thank you so much sir!! Welcome Back! But sir Kya ye sahi ki whole day wait kre aur Next day bs ek video 🥲🥺 I know aap busy h kaafi but ye dil h ki Manta nahi.🥲
Well Sir, agar me ne chaey pehley hi pi li ho, or bad me is lecture ko dekh raha hun, koi tension to nahi??? hahahaha.. just for fun, Sir you are doing great. I really like you, Stack and Heap is root of any Programming language, but mostly mentor don't touch it, but you're covering this one also,, nice, great, marvellous.
Great explanation sir, Event loop bhi issi tarah se explain kar dijiye, woh bahot confusing hai. We know things but koi puche toh explain nahi kar pate ache se
Primitive data types are immutable and non-primitive data types are mutable. Primitive data type stored in stack memory and non primitive data types are stored in heap memory.
primitive data type has 7 type Number = number , String = string, Boolean = Boolean, understand = object, symbol=symbol, bigint=number, null = object. Non primitive Array, object, function
this video cover a part of crud update he is updating a value in object for example if you wanna change email of your in js then you can do it dynamically using input tag
So the information is that primitive data type uses stack for memory allocation and it make the copy of the value whereas the non-primitive data type usese heap where value are refereenced .
function sum2(val1, val2){ return val1 + val2 } function sum3(val1, val2, val3) { return val1 + val2 + val3 } let sum = sum2; let addFun = sum; sum = sum3; console.log(sum.toString()); // get your function called console.log(sum(22,22,22).toString()); // function called and arguments passed var final = sum(22,22,22).toString(); // function called and passed into final variable console.log(final) // output 66 console.log(typeof(final)) // string // for addfun // let addFun = sum; // let sum = sum2; // means addFun = function sum2(val1, val2){ return val1 + val2 } console.log(addFun(22,22).toString()); // return 44 but in string // call your functions and then apply string method // as functions are stored in variable but not being called so the variable get all the syntax of the function ..... console.log(sum) but u never call sum ..... sum has the sum 2 function so sum will print you all the syntax of the sum 2 function if you do sum = sum2(); then you will get the sum2 function value to sum variable // and the non primitive datatype directly gives u the address of the original variable or function so when ever you make any assignment it goes reflected to original variable or function . you make many swaps but at the end your main or original function is going to affect.
@@VikashSingh-hc6zo I got it bro,,,, I directly swap main functions. If I assign any function to variables and any change happen to main function's prototype then we got changes reflected on all variables