Control flow in javascript in 1 shot | chai aur
Вставка
- Опубліковано 18 вер 2024
- Visit chaicode.com for all related materials, community help, source code etc.
#javascript #hindi
Sara code yaha milta h
github.com/hit...
Discord pe yaha paaye jaate h:
hitesh.ai/discord
Instagram pe yaha paaye jaate h:
/ hiteshchoudharyofficial - Наука та технологія
2:13 - why control Flow?
2:54 - if-statement
5:00 - comparison operators
10:20 - "else" keyword
11:40 - difference between "var" & {"let", "const"} regarding scope.
14:42 - Implicit scope
16:17 - suggestion
17:00 - else - if
23:36 - practical use case mentioned
24:33 - switch case statement (useful in redux)
30:12 - "truthy" & "falsy" values.
33:04 - Rules of "truthy" & "falsy" consideration
37:18 - Empty array check
38:10 - Empty object check
41:00 - nullish coalescing operator
42:25 - significance of "??" operator
46:00 - confusion warning!!
48:25 - summary
very helpful!!
thanks
Thanks a lot 🙌🏻, this is very helpful!
const balance=1000;
if (balance>500)console.log("safe");
console.log("safe");
at 17:04 u told implicit code after(;)wont run it is runnung
@@nameisezdon’t put ; after first console but put , thn it will work ; this is used in last console
minor error at 28:15. If there is no break statement added before the default case, default will also be executed. In this example, the default case was not executed because the break keyword was used before it.
Thanks for this series btw..!! ❤❤❤
Oops my bad. Thanks for pointing it out
@@chaiaurcodesir you are like a hidden Einstein for students,
Even intricate things you make so simple for us,
just by your simplicity of teaching,
Glad i found you on youtube,
thanks to you youtube ,
he had given a mentor like you,
Sir ❤❤❤
@@chaiaurcode kinndly give warning in description some student might face issues in future
Unstoppable. 💨
06:37 Control flow is an important concept in JavaScript that allows the program to execute certain code based on conditions.
13:14 Control flow in JavaScript involves the use of conditional statements.
19:51 The scope of variables declared using the const and let keywords is limited to the block they are declared in
26:28 Control flow in JavaScript involves executing different portions of code based on conditions.
33:05 Understanding control flow in JavaScript
39:42 Falsy values in JavaScript include false, 0, negative 0, empty string, null, undefined, and NaN.
46:19 Understanding the concept of nullish coalescence operator in JavaScript.
52:50 The video covers control flow in JavaScript, including the ternary operator and if-else statement.
"Haan ji", "Koi dikkat hi nahi hai" has a seperate fan base
First time i didn't get bore in such long tutorial video, you nailed it Hitesh Sir, salute to you.
whenever i saw your youtube channel and learn programming language not only learn programming language but also understand that topic used in IT production thank you sir for making javascript series in hindi i hope the best series in youtube 😀😀😀
06:37 Control flow is an important concept in JavaScript that allows the program to execute certain code based on conditions.
13:14 Control flow in JavaScript involves the use of conditional statements.
19:51 The scope of variables declared using the const and let keywords is limited to the block they are declared in
26:28 Control flow in JavaScript involves executing different portions of code based on conditions.
33:05 Understanding control flow in JavaScript
39:42 Falsy values in JavaScript include false, 0, negative 0, empty string, null, undefined, and NaN.
46:19 Understanding the concept of nullish coalescence operator in JavaScript.
52:50 The video covers control flow in JavaScript, including the ternary operator and if-else statements.
Sir I'm currently watching your video, but I haven't finished it yet. but ley me say you something before I go ahead Thank you so much for your comprehensive explanation of truthy and falsy in JavaScript! Your video really helped me grasp these important concepts. I appreciate your clear and engaging teaching style. Keep up the great work!
I learn so much from this video....
Me jb bhi Chai or Code pr aata hu muje hmesha kuch nya sikhne ko milta hai... ❤❤
function isJavascriptHard(teacher){
if(teacher=="Hitesh Choudhary"){
console.log("Javascript is easy")
}
else{
console.log("javascript is difficult")
}
}
isJavascriptHard("Hitesh Choudhary")
🖤💙🖤
waah kya baat :)
I am following this series I must say this content has one of the quality content out there on the internet. Thank you Hitesh Sir for this series.
Short summary at the end made all things clear!! Thanks!!
your voice give me peace while learning.....
finally i found a write course , i really liked your method of teaching rest of videos or js playlist directly jump on advance without any basic buildup , now i m confident about my js basics .
2:13 - why control Flow?
2:54 - if-statement
5:00 - comparison operators
10:20 - "else" keyword
11:40 - difference between "var" & {"let", "const"} regarding scope.
14:42 - Implicit scope
16:17 - suggestion
17:00 - else - if
23:36 - practical use case mentioned
24:33 - switch case statement (useful in redux)
30:12 - "truthy" & "falsy" values.
33:04 - Rules of "truthy" & "falsy" consideration
37:18 - Empty array check
38:10 - Empty object check
41:00 - nullish coalescing operator
42:25 - significance of "??" operator
46:00 - confusion warning!!
48:25 - summary
स्पॉइलर अलर्ट: यह वीडियो केवल फ्रेशर्स के लिए नहीं है, एक्सपायरीन्स के लोग भी इस मास्टर पीस से सीखेंगे।
- धन्यवाद हितेश
Please start a simple project using javascript...🥰🥰
Jitna pd liya h utna to relate kr paye atleast humlog ki how javascript use in project 🥺🥺
Aadha gyaan leke project ke chakrvyuh me mt utariye
@@chaiaurcode hanji bilkul jaisa aap kahen
@@chaiaurcodeproject kab aayenge
45:59
// Another case:
let value = null ?? undefined; // Output = undefined
or
let value2 = undefined ?? null; // Output = null
// In both the cases above the second value is picked since `??` considers null and undefined equally.
padhte padhte chai hi thandi ho rahi hai guruji 😅
Thank you for exceptional efforts in simplifying JavaScript 😇😇
the way of understanding else was just wow . 😮
Loved your content. Thank you so much, Best Javascript series!!
Thank you Sir! Now I understand better how Execution of functions happens. Also the demo of call stack on browser was very helpful.
hiii
06:37 Control flow is an important concept in JavaScript that allows the program to execute certain code based on conditions.
13:14 Control flow in JavaScript involves the use of conditional statements.
19:51 The scope of variables declared using the const and let keywords is limited to the block they are declared in
26:28 Control flow in JavaScript involves executing different portions of code based on conditions.
33:05 Understanding control flow in JavaScript
39:42 Falsy values in JavaScript include false, 0, negative 0, empty string, null, undefined, and NaN.
46:19 Understanding the concept of nullish coalescence operator in JavaScript.
52:50 The video covers control flow in JavaScript, including the ternary operator and if-else statements.
Crafted by Merlin AI.
sir you are giving best of yours and this type of tutorials will help for those types of students who all are learning code through free and social resources.
So much understanble content you make ! thank you for making js in depth with understandable with your teaching way 🌻_🌻 Sir please ap react js ki bi series bna dijiee
Krte h prabandh
Couldn’t ask for a better video
Thanks
sir aap teacher best ho bahot maja aa rha hai reading karne mai
best course ever on youtube👍
🎯 Key Takeaways for quick navigation:
00:28 🧠 *Understanding data types and execution in JavaScript is crucial for building a strong foundation in programming.*
00:57 💡 *The video aims to cover control flow comprehensively within a single video, focusing on syntax and avoiding unnecessary repetition.*
01:54 🌐 *Creating files within the "04" folder, starting with a file named "$1.js" for organizing the code.*
02:09 👀 *Checking the code files to ensure that functions, scopes, and other components are correctly set up for execution.*
02:36 🔄 *Control flow or logical flow in programming should dictate when specific portions of code run based on conditions, enhancing overall program control.*
03:05 🔄 *When writing conditions, open the scope after it. The internal code inside the scope will execute only if the condition is true.*
03:31 ⚠️ *Be cautious about statements like "if false, later false." Only execute the code inside the scope if the condition is true.*
04:10 ⚖️ *Basic conditions involve checking if a value is equal, greater than, or less than another. Understand how comparisons work.*
05:00 🔄 *When comparing values, operators like "greater than," "greater than or equal to," and "equal to" help define conditions in your code.*
05:56 🔄 *Understand the difference between single and double equals. Single equals assigns a value, while double equals checks for equality.*
06:10 🔄 *Use "==" for checking equality in conditions, and "=" for assignment. Clarify the purpose of operators to avoid confusion.*
06:24 ❌ *Be cautious with negative statements in conditions. Verify that your negations and checks provide the expected results.*
06:38 🔄 *Conditional statements in JavaScript can be implemented using if conditions.*
07:09 📝 *Triple equals (`===`) in JavaScript checks both value and type equality.*
07:25 🚀 *Executing code based on strict type checking can be achieved using strict equality (`===`).*
09:17 🌡️ *Implementing a basic temperature check using if conditions and strict equality in JavaScript.*
10:17 🧐 *To check conditions in JavaScript, use keywords like `if` and `else`. Ensure that the conditions are correctly formulated.*
11:51 🧮 *Scope is essential; understanding global and function scope helps prevent variable conflicts and ensures code functions as intended.*
15:22 🛠️ *Use "direct" to execute code directly within the scope. Be cautious with implicit scopes; one-line execution is automatic.*
15:50 📄 *Write multi-line conditions by using common practices, and execute tests for verification.*
16:32 ❌ *Avoid impractical practices for the sake of impressing others; prioritize clean and readable code over unnecessary complexity.*
16:45 🔑 *Understanding the basics of how "if-else" conditions work in JavaScript; focus on nesting and executing conditions as needed.*
16:59 🔄 *Introduction to nesting in JavaScript; the importance of checking multiple conditions and handling scenarios with multiple conditions.*
17:27 🛠️ *Using if-else statements with greater than (>) condition to execute code.*
18:01 🧐 *Implementing multiple conditions using else-if statements.*
18:54 🧠 *Using the else statement for a final execution when no conditions are met.*
19:24 🤔 *Discussing the application of multiple conditions in real-life scenarios, such as online shopping.*
20:08 💳 *Exploring the concept of multiple conditions for user access and transaction authorization.*
21:22 🔄 *Using multiple if statements for handling various conditions.*
22:03 📝 *Implementing conditional rendering based on user details like email format, day availability, and having a debit card.*
23:19 ✔️ *Simplifying conditions by combining multiple checks, ensuring at least one condition is true.*
23:46 🛑 *Dynamically changing UI elements based on user conditions (e.g., showing login/logout buttons).*
24:14 📂 *Introduction to creating a new file and exploring different formats in JavaScript control flow.*
25:37 🔄 *Demonstrating the use of the `switch` statement with a practical example of checking values against different months.*
26:04 🔄 *Explaining the importance of using a `break` statement in each `case` to avoid fall-through in the `switch` statement.*
26:44 🔄 *Demonstrating the use of the `break` statement to prevent fall-through in a `switch` statement.*
27:14 🔄 *Discussing the default case in a `switch` statement and how it can be used to handle unmatched conditions or execute default code.*
27:42 🔄 *Understanding how control flow works in JavaScript, especially with break statements in loops.*
28:10 🐍 *Modern languages like Swift handle control flow differently, in contrast to older languages like JavaScript.*
29:05 🚧 *Demonstrating the importance of sensitivity when matching values and utilizing exact matches with the `===` operator.*
29:35 🔄 *Simplifying value comparison by using brackets and the equality operator (`===`), reducing the need for additional comparison operators.*
30:45 📁 *Creating a new file named "truth-and-error.js" for error and truth values.*
31:30 🖨️ *Discussing the challenge of printing on the web based on conditions.*
32:00 🔄 *Handling scenarios where an email is present, and the code runs successfully, exploring behind-the-scenes of the code execution.*
32:14 ❓ *Discussing an interesting situation where no comparison is made, and the code runs without checking the condition.*
32:28 🔍 *Demonstrating how to check for the existence of a true value within a string.*
32:43 🚫 *Handling scenarios where the email value is an empty string and ensuring the code works with different situations.*
33:10 📝 *Summarizing the types of truth and false values present in the code.*
33:23 ✔️ *Listing the values, including true, false, obvious false, zero, and handling special cases.*
33:50 🚧 *Clarifying that negative zero is generally considered as a false value, except in specific scenarios.*
34:18 🔄 *Null and Undefined are considered false values in JavaScript.*
34:47 🕵️ *When dealing with error values, pay attention to the "False Values" and "True Values" within the code.*
35:29 🚀 *Some error values may surprise you, so being subscribed to the channel helps in staying informed.*
35:42 📝 *When writing code within a string, be cautious about how zero and other values are interpreted as error values.*
35:56 🔍 *White spaces within strings can also be interpreted as error values, so be mindful of them.*
36:24 📜 *Function declarations without parameters or execution code inside are also considered error values.*
36:38 🧐 *Understanding how various values, including objects, are recognized as error values is crucial for developers.*
37:04 🤯 *Error values become more apparent when working on projects, emphasizing the importance of checking conditions effectively.*
38:30 🕵️♂️ *Detect if an object is empty by comparing its length property with zero after converting it to a string.*
38:58 🛠️ *Demonstrate the practical application of object detection in a scenario where you want to check if an object is empty.*
39:11 🤔 *Understand the basic principles of object detection and apply them to improve code efficiency.*
39:38 🔄 *Clarify the distinction between "==" and "===" operators when comparing values, and be aware of their implications.*
39:52 🧠 *Understand the outcomes of equality comparisons with "===" and "==" operators to handle truthy and falsy values effectively.*
41:18 🛠️ *The "nullish coalescing" operator checks specifically for null and undefined, providing a concise way to handle default values.*
41:36 📝 *Use the nullish coalescing operator (??) to assign a default value if a variable is null or undefined.*
44:14 🔄 *Avoid confusion between undefined and null by using nullish coalescing operator (`??`).*
44:58 ➡️ *Nullish coalescing operator is designed specifically for null and undefined, providing a convenient solution.*
45:40 🚧 *Handle errors effectively and assign values with a fundamental understanding of the process.*
46:06 🔀 *Differentiate between nullish coalescing operator, nullish collation operator, and ternary operator.*
47:40 🔄 *Basics of conditional statements in JavaScript are demonstrated, using operators like greater than (`>`).*
47:53 📏 *Comparison of values using conditional statements, emphasizing the importance of checking conditions correctly.*
48:08 🔄 *Introduction to conditional flow control with a basic example of checking if the price is less than 80.*
48:20 📝 *Summary of controlling code execution based on conditions and the need for control in different situations.*
48:49 🤔 *Understanding conditional execution based on various conditions like user ratings and temperature.*
51:10 🎭 *Introducing the concept of Nullish Coalescing Operator (`??`) for handling multiple function calls and addressing potential issues with direct value display.*
51:39 ⚠️ *Demonstrating the use of the question mark (`?`) and flag values to handle scenarios where functions may return `null` or `undefined`.*
Made with HARPA AI
Feeling blessed that i get to know about this channel after watching lots of lots of crap content.
बहुत बहुत धन्यवाद आप का hitesh sir ❤
Thank you so much sir 😊, sir node js ki bhi playlist banaiye please
Bhai saab ma kehta hoo apna tou dil jeet lya sir g . Lub you ho gya.
Guru ji aapki video se padhne main maja hi or hai. Aisa lgta hai ki bas padhte rhu😌😌
bs to 1 aur aisa hi video ready kr rha hu, Sunday ko laate h
@@chaiaurcode love u guru ji❤
amazing tutorial
Best video on intenet for javascript
yr ap kamal banday ho hats off love from pakistan ❤
wow maja a gya 52 mins bina kisi skip k dekha or ek dam clear samagh a gya
thanks a lot sir !
i will definately text you whenever i gets the job to express my appriciation towards you and your work
"'kyunkin jab tak padne m maja nhi ayega to seekhenge kese "
Sahi baat. ☕️❤️
@@chaiaurcode sir mere aik Question hai
very very well explained sir
Sir ap bahot hi imandari se padhate hai thankyou ❤
boht maza aaya.. too much to learn... do make long videos :)
Hey Hitesh sir , a suggestion I would like to provide. It would be really better if you provide timestamps for topics covered. It really helps a lot in naviagtion.
Ab itna yogdaan to kisi ko comment section me b dena chahiye na
sir ka pdhane ka trika such me alg hai faltu ki baat to krte hi nhi hai sir thank you so much sir
Best video of this js series
1:37 am Hitesh Sir javascript with smile on face and calmness in voice + Lofi study music in background .I don't expect more than this .❤❤❤❤
😊☕️🤗
Long video ka ek alg hi mja h next level
Thank you sir for too much effort
Thank you a lot sir for making this wonderJSl js playlist video @chaiaurcode .
Awesome!!
not sure why comments are less but it is what it is lol. I would like to pay something for this as well
Supporting you hitesh bhai
you are good teacher and clear all the topics for depth.
short summary wala formula best ye methodology sb videos mein hona chahiye✅
"Chai aur Code, you're the unsung hero of the JavaScript learning community. You rock!"
concise and clear, thank you :)
So much information in one video
you nailed man,, from karachi
26:34 ==> you can also change shortcuts ==> { Settings/Keyboard Shortcuts/Select your shortcut and apply!}
Personally I use " CTRL + D "!
Thanks Me Later!😜
unbelieveable teaching way that i have see till now
Bahut sahi👍
❤️😊
Amazing Video Sir Ekdum Full Clarity and quality ke sath
🙏🙏 thank you so much for your precious Video(Javascript Series) 🙏🙏😃 Maazaa aa rha hain !
Chai aur concept clear❤
Thank you very much sir !! ❤❤
"Master JavaScript control flow with ease! This tutorial covers if-else, switch, loops, and more. #concise #clear"
maze aaagye mast lecture val1 = null ?? 10 ?? 50 yeh acha concept thaaa
again learnt lot of new things
Kya hi samjhaye hai sirji
Thank you so much Sir, for the amazing and helpful content 😇😇
I am telling you this guy is providing Premium content for free of cost Just subscribe to his channel and watch this Javascript series.
Love and Respect from Pakistan.
Love these long videos! Too much to learn! Time to get back to chai and code!! 😁
Thank you sir for making javascript series in hindi i hope the best series in youtube...
Starting me low energy hua chai bhi ready h and that....😂😂😂...
Sir app to strong rahiye pls............
Sir you are legend..Just learning from your series..hope that ill master Js
Great initiative ❤
Hats off sir me to Dhanya ho gya aapke lecture dekh ke ❤
Loving this series thank you sir 🎉🎉 #15DayJavaScriptChallenge
absolutely enjoying this javascript course ,,,,,,,,,,,,,,,,,,,,,,,,,,
awesome video sir maja aa gya padh ke app se java script
Awesome content, keep the good work coming. Thanks..
Txs u so much boss and your grand hug and txs apki wja se bhot log jo pese ni dy pate in sub ki study ke liy or ap un sub ke liy itna efect dal rhy uske liy so txs 👏👏🥰🥰
Sir your way of teaching is truly amazing ❤❤
sir, your chanel is very best for beginner student.
Your course is well organised as per today's era.
Sir, when I am typing let name='name' and then comparing it to true as *name==true*, the console is returning me false. Why is that so? Shouldn't it return me true?
Try name = true
The output would be "false".Here's why: In JavaScript, the if statement checks the condition inside the parentheses. The condition name == true checks if the value of name is strictly equal to true. Since name is a string with the value 'name', it is not equal to the boolean true. Therefore, the condition evaluates to false, and the else block is executed, resulting in the output "false".
Tried chat-gpt and got the reason.
If we don't use break then wherever the value matches, the code will print all values after that until it finds another break.
Thanks @Chai aur code ,@Hitesh Choudhary SIR .....
Love from belguim brother love the way your explaining best of luck 👌👌👌👌👌👌👌🕳🕳
Thank you sir
Code wagrah toh apka Tagda hi hai
Agar CHAI ki receipe share krdete toh maja hi aajata 😅😅😄😄
Optional chaining Is also there...
Do explore that too guyz...
controls concept with simple and easy way
Best tutorial in control flow for java script. :)
Best tutorial of js over UA-cam
34:30 sir i think document.all is also considered to be falsy....BTW great lecture from u sir.....love it a lot
sir thanku for the truthy and falsy concept i was always confused of this
thank you so much
Well done sir❤
Thanks sir, ase ho in-depth me samjaiye
sir, your way of teaching is amazing 🤩
enjoyed the whole lecture ❤❤
26/51 Done [17.1.24] ✅✅