Let, const and var ki kahani | chai aur #javascript

Chai aur Code
25 Dec 202216:40

Summary

TLDRWelcome to the JavaScript series on our channel! This video discusses the importance of learning JavaScript and setting clear goals beyond just coding. The instructor emphasizes building products like e-commerce websites or mobile apps. The video covers fundamental topics such as variables and constants in JavaScript, providing practical examples and best practices. It encourages viewers to have a project-oriented mindset and understand the real-world applications of JavaScript, aiming to help them become successful developers who can create meaningful projects.

Takeaways

  • 😀 The video is part of a JavaScript series, focusing on why JavaScript should be learned and its applications.
  • 🏆 The presenter encourages viewers to learn JavaScript for building e-commerce websites, social media applications, or mobile apps, rather than just for coding syntax.
  • 💡 The video emphasizes that those who stick in the industry often have a goal of creating something, like a product or working for a big company.
  • 🌐 The presenter introduces variables and constants as the starting point for learning JavaScript, explaining their basic concepts and usage.
  • 🔍 The importance of understanding how to store information, such as user data, is highlighted, which is crucial for building websites and applications.
  • 📚 The video suggests looking at documentation and exploring how variables and constants are declared in JavaScript, which is essential for learning the language effectively.
  • 📝 The script includes a practical example of declaring variables for user registration information like account ID, email, password, and settings, demonstrating how to store and manipulate data.
  • 👀 The presenter discusses the difference between 'let' and 'const' in JavaScript, explaining that 'const' is used for values that should not change, while 'let' allows for change.
  • 🚫 A cautionary note is given against using 'var' due to its issues with block scoping and potential for causing bugs in the code.
  • 💻 The video concludes with a teaser for the next video, promising more insights into JavaScript and its practical applications in building projects.

Q & A

  • What is the main purpose of the video?

    -The main purpose of the video is to introduce and start a series on JavaScript, focusing on why one should learn JavaScript and setting up the environment for learning variables and constants.

  • Why should someone learn JavaScript according to the video?

    -The video suggests learning JavaScript for those who aim to build something, like an e-commerce website, a social media application, or a mobile app, rather than just for the sake of learning programming syntax.

  • What is the importance of setting clear goals before starting to learn JavaScript?

    -Setting clear goals is important because it helps in maintaining interest and persistence in the industry, and it guides the learning process towards building practical applications rather than just theoretical knowledge.

  • What are variables and constants in the context of JavaScript?

    -In JavaScript, variables are containers for storing information that can change, while constants are used to store information that should not change once declared.

  • Why is it recommended to use 'let' instead of 'var' in JavaScript?

    -The use of 'let' is recommended over 'var' due to its block scope, which prevents issues related to variable hoisting and helps in avoiding unintended variable overwrites in different scopes.

  • What does the video suggest about the mindset of successful programmers?

    -The video suggests that successful programmers have a goal-oriented mindset, focusing on building products or creating something of value, rather than just learning to code.

  • What is the role of 'console.log' in JavaScript as mentioned in the video?

    -'console.log' is used to output information to the console, which is helpful for debugging and displaying the values of variables during runtime.

  • What is the significance of understanding the scope in JavaScript?

    -Understanding scope is crucial because it determines the accessibility and lifespan of variables and functions within the code, preventing conflicts and unintended modifications.

  • Why might someone choose to use constants over variables in certain situations?

    -Constants are chosen over variables when the value should remain unchanged throughout the program's execution, ensuring that critical data remains consistent and secure from accidental modifications.

  • How does the video approach the concept of learning by doing in JavaScript?

    -The video encourages learning by doing by suggesting the creation of an e-commerce website or a social media application as practical projects to apply JavaScript concepts and enhance understanding.

  • What is the advice given in the video regarding the declaration of variables and constants in JavaScript?

    -The video advises to use 'const' for constants and 'let' for variables, emphasizing the importance of naming conventions that are easily readable and follow common syntax to avoid confusion.

Outlines

00:00

📝 Introduction to JavaScript Learning Series

The script introduces a new video series focused on teaching JavaScript. It emphasizes the importance of learning JavaScript for those who aim to build e-commerce websites, social media applications, or mobile apps. The instructor poses questions to the audience about their motivations for learning JavaScript, suggesting that those who wish to create products or build a career in the industry are in the right place. The video promises to guide viewers through the process of setting up their environment and starting with variables and constants, hinting at the practical aspects of coding and the industry relevance of the lessons.

05:00

🔑 Understanding Variables and Constants in JavaScript

This paragraph delves into the basics of variable and constant declarations in JavaScript. It discusses the importance of naming conventions for readability and consistency with programming syntax. The script provides examples of declaring variables such as 'accountID', 'accountEmail', and 'accountPassword', and constants with the keyword 'const'. It also touches on the concept of immutability of constants and the use of console.log for printing values to the console, highlighting the practical steps a programmer might take when declaring variables and constants.

10:02

🛠️ Practical Exploration of Variable Declaration and Usage

The script continues with a practical exploration of variable declaration, discussing different approaches and the implications of using 'let' and 'var'. It explains the historical context of JavaScript's scoping issues and the introduction of block scoping with 'let' to avoid conflicts. The paragraph also cautions against the use of 'var' due to its function-scoped nature, which can lead to unexpected behavior in larger codebases. The instructor emphasizes modern JavaScript practices, advising against the use of 'var' and recommending 'let' and 'const' for variable and constant declarations.

15:02

🚀 Conclusion and Preview of Upcoming JavaScript Topics

In the final paragraph, the script wraps up the current topic and teases upcoming lessons in the JavaScript series. It reflects on the importance of understanding variable declaration and scope before moving on to more advanced topics. The instructor encourages viewers to subscribe for the next video, promising to cover more in-depth concepts and practical applications in future lessons. The summary ends with an anticipation for the continuation of the series, aiming to build on the foundational knowledge presented in this video.

Mindmap

Keywords

💡JavaScript

JavaScript, often abbreviated as JS, is a high-level, interpreted programming language that is primarily used to enhance the interactive features of websites. In the script, it is the central theme, with the speaker discussing the importance of learning JavaScript for building web applications and the series of tutorials that will cover various aspects of the language.

💡Variables

Variables in programming are symbolic names for storage locations that hold values which can change during the execution of a program. In the script, variables are introduced as a fundamental concept in JavaScript, with the speaker explaining how to declare and use them to store information like account IDs, emails, and passwords.

💡Constants

Constants in programming are identifiers, unlike variables, which are given a value only once and this value cannot be changed throughout the life of the program. The script discusses the declaration of constants in JavaScript using the 'const' keyword and emphasizes the use of constants for values that should not change, like configuration settings.

💡Declaration

Declaration in programming refers to the act of introducing a variable or constant to a program by specifying its type and name. In the context of the script, declaration is a key process in defining variables and constants that will be used throughout the JavaScript code to store and manipulate data.

💡Scope

Scope in programming defines the visibility and lifetime of variables and functions within the code. The script touches on the concept of scope, particularly in relation to the 'var' keyword, which can lead to issues if not properly managed due to its function-scoped nature, as opposed to 'let' and 'const' which are block-scoped.

💡Comments

Comments are used in programming to explain the code, and they are ignored by the compiler or interpreter. In the script, the speaker discusses the use of comments in JavaScript to annotate the code, using both single-line comments with '//' and multi-line comments with '/* */'.

💡Assignment

Assignment in programming involves associating a value with a variable or constant. The script explains how to assign values to variables in JavaScript, which is a fundamental operation for setting up and manipulating data within the code.

💡Data Types

Data types define the classification of data in terms of what values it can contain and what operations can be performed on it. Although not explicitly mentioned in the script, understanding data types is crucial when declaring variables and constants in JavaScript, as they determine the kind of values that can be stored.

💡Functions

Functions are reusable blocks of code that perform a specific task. While the script does not delve into functions in detail, the speaker does mention 'functional scope,' which is a concept related to how functions encapsulate their own scope, separate from the global scope.

💡Console

The console in JavaScript refers to a debugging tool that allows developers to output information to a text-based interface. In the script, the speaker uses 'console.log' to demonstrate how to print variable values to the console, which is a common practice for testing and debugging code.

💡E-commerce Website

An e-commerce website is a platform that facilitates online transactions涉及电子商务网站的概念,即在线交易的平台。 In the script, the speaker uses the creation of an e-commerce website as an example project to illustrate the practical applications of JavaScript, emphasizing the language's capabilities in building interactive and functional web applications.

Highlights

Welcome to the channel and introduction to a new video series on JavaScript.

The importance of learning JavaScript for building products and its industry relevance.

Discussion on the goals of learning JavaScript, such as creating e-commerce websites, social media applications, or mobile apps.

The distinction between those who learn coding for the sake of learning and those who aim to build something significant.

Explanation of environment setup for starting with JavaScript.

Introduction to variables and constants as the first topic in the JavaScript series.

The concept of constants that cannot be changed once declared.

Variables that may change or be modified during the program execution.

The process of declaring variables and constants in JavaScript with examples.

The significance of naming conventions in variable declaration for readability.

How to store user information like email, password, and settings in variables.

The use of console.log to print variable values for debugging purposes.

Differences between 'let' and 'var' in variable declaration and the scope issues associated with 'var'.

Recommendation to avoid 'var' due to scoping problems and to use 'let' and 'const' instead.

The concept of functional scope and how it relates to variable declaration.

How to use comments effectively in JavaScript to improve code readability.

The impact of using 'let' and 'const' on the scope of variables within blocks and functions.

A note on the default value of variables if not assigned during declaration in JavaScript.

The tutorial's approach to teaching JavaScript with a focus on practical application and project-oriented learning.

Transcripts

play00:00

हान जी स्वागत है आप सभी का चाय और कोर्ट

play00:02

में उम्मीद करता हूं आपकी चाय तैयार होगी

play00:04

क्योंकि कोड यहां पे तैयार है स्वागत है

play00:07

एक और नए वीडियो में जो की है हमारी

play00:09

जावास्क्रिप्ट की सीरीज के अंदर तो अभी तक

play00:11

हमने सीरीज के अंदर देखा की हमारे

play00:13

जावास्क्रिप्ट क्यों सीखनी चाहिए किसने

play00:15

जाव स्किट बनाया क्या जाओ उसके टेंशन है

play00:17

जिनके बारे में और डिटेल में हम बात

play00:19

करेंगे अभी हम स्टार्ट कर रहे हैं

play00:20

एनवायरनमेंट सेटअप करने के बाद की हम

play00:23

वैरियेबल्स और कांस्टेंस से शुरू करेंगे

play00:25

उससे पहले मैं इसकी बात करूं सबसे पहले

play00:27

मैं आपसे क्वेश्चन करना चाहूंगा क्यों आए

play00:29

हैं इस चैनल पे क्यों आए हैं प्लेलिस्ट पे

play00:32

क्यों सीखना है आपको जावास्क्रिप्ट यह

play00:34

सबसे जरूरी क्वेश्चन है अगर आप सिर्फ एक

play00:37

प्रोग्रामिंग सीखने के लिए आए हैं की मुझे

play00:39

कोडिंग सीखनी है इसलिए मैं जैकी सिख रहा

play00:41

हूं तो शायद मैं और आप सही नहीं है आप इस

play00:45

चैनल पर ना ही रहे तो ठीक होगा क्योंकि जो

play00:47

लोग सिर्फ कोडिंग सीखने के लिए कोडिंग और

play00:49

लैंग्वेज सीखना है वो ज्यादा दिन इस

play00:51

इंडस्ट्री में नहीं टिकते हैं जो लोग

play00:54

टिकते हैं वो उनका जो उद्देश्य होता है

play00:56

मोटे होता है वो होता है कुछ बिल्ड करना

play00:58

कुछ प्रोडक्ट बनाना है और वही लोग आगे

play01:01

जाकर कुछ हिस्ट्री बनाते हैं या किसी बड़ी

play01:03

कंपनियों में कम करते हैं तो अगर आपका गोल

play01:05

है की मैं बनाना चाहता हूं एक ए कॉमर्स

play01:07

वेबसाइट एक सोशल मीडिया एप्लीकेशन या फिर

play01:11

एक मोबाइल ऐप जो की उबर जैसी दिखे या

play01:13

सोमैटो का क्लोन मोबाइल पे या वेब पे कुछ

play01:15

इस तरह का अगर आप बनाना चाहते हैं तो आप

play01:18

सही बात है क्योंकि जार्विस स्क्रिप्ट्स

play01:20

से आप ये सब बना पाएंगे मोबाइल ऐप्स वेब

play01:22

ऐप्स और ये सब अगर आपके दिमाग में अभी भी

play01:24

गोल नहीं ए रहा है तो एटलिस्ट एक गोल तो

play01:27

इस वीडियो के थ्रू पे कर लीजिए की मैं आई

play01:29

कॉमर्स वेबसाइट बनाऊंगा एक सोशल मीडिया

play01:30

वेबसाइट बनाऊंगा ताकि ये जो तभी हम बात कर

play01:33

रहे हैं वैरियेबल्स कांस्टेंट लूट ये सब

play01:35

व्यर्थ ना जाए बहुत से लोग सिर्फ

play01:37

प्रोग्रामिंग सिंटेक्स के लिए सीखते हैं

play01:39

की मुझे बस ए जाए इससे मुझे बड़ी जॉब मिल

play01:41

जाए बट मुझे पता है आप लोग ज्यादा दिन

play01:43

नहीं टिक पाओगे क्योंकि वो जो गोल है वो

play01:45

ठीक नहीं है माइंड सेट करें तो खेल है तो

play01:47

शुरू करते हैं उम्मीद करता हूं आप सभी का

play01:49

गोल है की आप एक ए-कॉमर्स वेबसाइट बनाना

play01:51

चाहते हैं कुछ ऑनलाइन बेचना चाहते हैं

play01:53

उसके लिए वेबसाइट चाहिए कुछ मोबाइल ऐप

play01:55

बताना चाहते हैं अगर हान तो आप सही जगह पे

play01:57

है तो हम सीखेंगे तो इस सीरीज के दौरान

play02:00

मैं आपको सिंपली वेक एग्जांपल नहीं दूंगा

play02:03

की इसलिए वेरिएबल डिक्लेयर करो या इसलिए

play02:04

मैं आपको पूरा एक जर्नी के थ्रू डिस्कवर

play02:06

करवाऊंगी की ज्यादा स्क्रिप्ट क्यों सिख

play02:08

रहे हैं और क्या कर रहे हैं आप तो अभी हम

play02:10

डिक्लेयर करते हैं या फिर हम असम करते हैं

play02:12

की आगे जाकर मुझे एक वेबसाइट बनानी है जो

play02:15

की आई कॉमर्स वेबसाइट होगी फ्लिपकार्ट मैन

play02:17

लो सो बैठो मैन लो स्विग्गी मैन लो ये सभी

play02:20

कमर्शियल्स है कुछ ना कुछ ऑनलाइन बेच रहे

play02:22

हैं तो उसके लिए सबसे पहले क्या होगा की

play02:25

मुझे एक यूजर को अपनी वेबसाइट पे बुलाना

play02:27

है और उससे एक रजिस्ट्रेशन फॉर्म भरवाना

play02:30

है उसे रजिस्ट्रेशन फॉर्म के अंदर मुझे

play02:32

उसको एक यूनिक आईडी भी देना पड़ेगा ताकि

play02:34

वो जब मेरी वेबसाइट में आई या मेरी

play02:36

डेटाबेस के अंदर रजिस्टर करें तो मैं

play02:37

यूनिक लिस्ट को पहचानता हूं अभी सब

play02:39

फिक्टिशस है ऐसा कुछ नहीं होती है सिर्फ

play02:42

ख्वाब भी पुलाव है जिनकी हम बातें कर रहे

play02:43

हैं बट ये जो क्राइटेरिया है पर्सपेक्टिव

play02:46

है की हम क्या करना चाह रहे हैं उसके लिए

play02:48

हम यह सब सिख रहे हैं वो आपको चीजों का

play02:50

आसान बनाता है तो जैसे यूजर आया तो मुझे

play02:53

उसका नाम चाहिए ईमेल चाहिए उसकी सिटी भी

play02:55

जान नहीं है और उसका स्टेट भी जानना है और

play02:58

यह सब मैं एक कहीं ना मुझे स्टोर रखना

play03:00

पड़ेगा अब हालांकि डेटाबेस में स्टोर रखना

play03:02

चाहिए बट वो बातें तो हम बाद में करेंगे

play03:04

पर अभी मैं करता हूं की कैसे मैं उसको

play03:06

स्टोर रख सकता हूं कुछ भी चीज जब आप स्टोर

play03:08

रखते हैं तो उसके लिए आपको एक मेमोरी

play03:10

स्पेस चाहिए होता है की यहां पे मैं कुछ

play03:12

देर के लिए जो भी इनफॉरमेशन है उसको रख

play03:14

लूंगा और सारा खेल प्रोग्रामिंग में इस

play03:17

इनफॉरमेशन को स्टोर करने का वहां से

play03:18

निकलने का ऑप्टिमाइज तरीके से स्टोर करने

play03:21

का है तो उसके लिए पहला जो टॉपिक आप पढ़ते

play03:23

हैं वो होता है वैरियेबल्स और कांस्टेंट

play03:25

बहुत ही आसान है कांस्टेंट मतलब जिसको एक

play03:28

बार डिक्लेयर कर दिया उसको चेंज नहीं करना

play03:30

है मुझे बार-बार या मैं चेंज नहीं भी कर

play03:32

पाऊं ताकि गलती से भी अगर मैन करें तो

play03:33

नहीं करो और होते वैरियेबल्स जो की आगे

play03:36

जाके शायद चेंज हो जाए या कुछ बदल जाए इस

play03:38

तरह के तो jafrift में देखते हैं की कैसे

play03:41

हम किसी यूजर को अपनी वेबसाइट पे बुलाएंगे

play03:42

और उसको रजिस्टर करने के लिए कुछ

play03:44

इनफॉरमेशन उससे लेंगे तो शुरू करते हैं तो

play03:47

उसके लिए हम जाएंगे वापस से हमारे फोल्डर

play03:49

में 016 बाय डी वे अगर आपको अभी तक नहीं

play03:51

पता ये सर हम कोर्ट कहां लिख रहे हैं तो

play03:53

पुराने वीडियो देखिए और अगर नहीं देखे हैं

play03:54

तो जाइए मेरी घटा propository पे

play03:57

getup.com / हितेश चौधरी वहां पे आपको

play03:59

पॉजिटिव पर क्लिक करेंगे तो जीएस दश हिंदी

play04:02

यूट्यूब दिखेगा वहां से कोड पे क्लिक करके

play04:04

लोकल पे क्लिक करके आप सारा कोड डाउनलोड

play04:06

कर सकते हैं पुराने वीडियो अगर देखें तो

play04:08

डायरेक्ट यहां पे भी लिख सकते हैं या फिर

play04:10

अपने सी एस कोड में भी लिख सकते हैं तो

play04:12

यहां पे आता हूं

play04:13

016 के अंदर एक नई फाइल हम क्रिएट करेंगे

play04:15

जिसका नाम होगा हमारा

play04:16

01 वैरियेबल्स क्योंकि वैरियेबल्स के बारे

play04:20

में ही तो पढ़ रहे हैं ठीक है ये फाइल ए

play04:23

गई अब हम क्या करते हैं सबसे पहले करेंगे

play04:25

इन्वेस्टिगेशन वाली पढ़ क्योंकि सबसे

play04:27

ज्यादा जरूरी आगे जाके मैं बताऊंगा कैसे

play04:29

डॉक्यूमेंटेशन से इन्वेस्टिगेशन वाली पढ़

play04:31

करते हैं जो आपको आगे जाके और नई लैंग्वेज

play04:33

सीखने में भी हेल्प करेंगे तो सबसे पहले

play04:35

मैं क्या करता हूं की देखता हूं की किस

play04:37

तरह से वेरिएबल में कांस्टेंट डिक्लेयर

play04:39

होते हैं बहुत ही आसान है आपको लिखना है

play04:41

सी ओ एन एस टी और उसके बाद में लिखता हूं

play04:45

यहां पे अकाउंट आईडी अब ये जो पैटर्न है

play04:47

वेरिएबल डिक्लेयर करने का यह बहुत सारे

play04:49

लोग आपको अलग-अलग राय देंगे कुछ इस तरह से

play04:51

बोलेंगे की अकाउंट आईडी दो शब्द हैं तो जो

play04:54

सेकंड लेटर है उसका फर्स्ट अल्फाबेट जो है

play04:57

जो सेकंड वर्ल्ड है उसका फर्स्ट लेटर

play05:00

कैपिटल होना चाहिए जैसे मैंने यहां पर

play05:01

लिखा आईडी या फिर अकाउंट नाम यह भी ठीक है

play05:04

कुछ लोग कहेंगे नहीं इस तरह से लिखना

play05:06

चाहिए कुछ लोग कहेंगे नहीं इस तरह से

play05:08

लिखना चाहिए सभी तरीके से सही है सबकी

play05:10

अपने-अपने दिमाग है सबके अपने रूल्स हैं

play05:12

आपको जो भी ठीक लगे वही सबसे ठीक है

play05:15

वैरियेबल्स डिक्लेयर करते टाइम मेरा एक ही

play05:17

सिंपल रूल होता है की नाम इजीली पढ़ने में

play05:19

ए जाए और प्रोग्रामर्स की दुनिया में ये

play05:21

सबसे कॉमन सिंटेक्स है अब ऐसा नहीं है की

play05:23

नहीं जावा में इस तरह से लिखते हैं सी

play05:25

प्लस प्लस तरह से इस तरह से लिखते हैं वो

play05:27

वही लोग बातें करते हैं जिनको अभी कोड

play05:29

लिखते हुए शायद हो गया तीन साल हुए हैं बट

play05:31

अंततः गोल यह है की अकाउंट जो भी आप

play05:34

वेरिएबल का नाम लिख रहे हैं वो इजीली

play05:36

पढ़ने में ए जाए बस इतना सा ही गोल है अब

play05:39

मैंने लिखा है यहां पर अकाउंट आईडी और

play05:40

मैंने यहां पे दिया अकाउंट आईडी 144 553

play05:44

दे दिया इन्वेस्टिगेशन कर रहे हैं उसके

play05:47

बाद मैंने कीबोर्ड उसे कर लेट और उसके बाद

play05:50

लिखा मैंने अकाउंट ईमेल और ईमेल देते हैं

play05:54

यहां पर मैं मेरा ईमेल उसे कर लेता हूं जो

play05:56

की है नहीं

play05:57

इसलिए उसे कर रहा हूं और उसके बाद मैं

play06:00

यहां पर एक और कीवर्ड उसे करता हूं वॉर

play06:02

अभी कीवर्ड क्या है अभी हम डिक्लेयर करते

play06:04

हैं अभी हम बात करते हैं इसके बारे में और

play06:06

हम लिखते हैं अकाउंट पासवर्ड और हमने

play06:09

अकाउंट पासवर्ड भी लिख दिया अब नोटिस करिए

play06:11

जो अकाउंट ईमेल है अकाउंट पासवर्ड लिख रहा

play06:14

हूं और लिखा वैन तू थ्री फोर फाइव ठीक है

play06:17

और उसके बाद मैंने लिखा एक अकाउंट सेटिंग

play06:27

और लिख देते हैं डबल कोट्स के अंदर वापस

play06:30

से जयपुर ठीक है इतना कम तो हो गया अब

play06:34

करते हैं हमारी इन्वेस्टिगेशन यहां पर तो

play06:37

ठीक है इससे पहले

play06:40

कुछ कांस्टेंट कीवर्ड्स होते हैं जैसा की

play06:42

मैंने आपको फर्स्ट वीडियो के अंदर बताया

play06:44

था की टेक्स्ट फाइल में डिफरेंस का है यह

play06:48

की शब्द ऑलरेडी जो कंपाइलर है

play06:50

जावास्क्रिप्ट का जो भी नोट जेएस है या

play06:52

फिर आपने v8 उसे कर है जो भी उसके अंदर

play06:54

कुछ सिंटेक्स डिफाइन है की अच्छा ये की

play06:56

वर्ड मिले तो ये करो यह की वर्ड मिले तो

play06:58

यह करो जैसे हमने देखा console.log मिले

play07:01

तो उसको स्क्रीन पर आउटपुट कर दो तो उसी

play07:03

तरह से वॉलेट या कंस मिले तो उसको मेमोरी

play07:06

के अंदर उसको असाइन कर दो तो मेमोरी का

play07:08

नाम दे दो अकाउंट आईडी और उसके अंदर जो

play07:10

वैल्यू और साइन करनी है वो ये असाइन कर दी

play07:12

ठीक है बड़ी छोटी सी बात है तो कंस का जो

play07:15

मतलब होता है वो ये होता है की अब इसको

play07:16

चेंज नहीं किया जा सकता जो भी एक बार आपने

play07:18

वैल्यू असाइन कर दी बस वही लॉक हो गई है

play07:20

वहां पे कई बार इंटेंशनली वैल्यू को लॉक

play07:23

करना ज्यादा अच्छा होता है प्रोग्रामिंग

play07:24

में बजाय उनको लेट पहले दिमाग में क्या

play07:27

आता है क्या अरे हर चीज चेंज होनी चाहिए

play07:29

ताकि जब भी मेरा मैन करें उसको चेंज कर लो

play07:31

बट ऐसा नहीं है कुछ चीज चेंज नहीं होनी

play07:33

चाहिए हान यानी की ज्यादातर चीज नहीं होनी

play07:35

चाहिए उसके बाद हम आते हैं यहां पे तो अब

play07:37

हम यहां पे क्या करते हैं सबको चेंज करके

play07:39

देखते हैं तो हम सबसे पहले करते हैं

play07:41

अकाउंट आईडी और अकाउंट आईडी का नाम यहां

play07:44

पे नंबर दे देते हैं तू अब आप देख लेंगे

play07:46

तो चेंज हो रहे हैं यहां पे मैं तो चेंज

play07:48

कर का रहा हूं आपने तो लिख दिया की चेंज

play07:50

कर रहा हूं बट याद रखिए सारे कोड को कोई

play07:53

एनालाइज भी करेगा

play07:55

या नहीं करने देगा वही सबसे इंपॉर्टेंट

play07:58

चीज है तो यहां पे हम आते हैं लॉक पे यानी

play08:01

की कंसोल डॉट लोग ये सबसे इजी शॉर्टकट है

play08:03

आप क्या कर सकते हैं सिंपली जाके लोग लिख

play08:05

सकते हैं और जैसे आपको सजेशन मिले आप इंटर

play08:08

करिए तो console.log लिख दिया जाता है आने

play08:10

वाले वीडियो में बताऊंगा किस तरह के

play08:11

शॉर्टकट्स आप कैसे बना सकते हैं सबर रखिए

play08:13

सब्सक्राइब करते रहिए सब कुछ मिलेगा तो

play08:16

मैंने यहां पे लिखा सिंपली की मुझे ये जो

play08:18

अकाउंट आईडी मैंने वेरिएबल डिक्लेयर कर है

play08:20

कांस्टेंट या वेरिएबल जो भी आप समझ गए हैं

play08:22

उसको मुझे प्रिंट कर दो ठीक है सब कुछ से

play08:25

कर टर्मिनल ओपन कर

play08:28

और इसको रन कैसे करते हैं रन करना वही

play08:30

सिंपल है हमने लिखा नोट और उसके बाद फाइल

play08:33

का नाम तो हमारे पास फाइल है जीरो वैन

play08:35

बेसिक के अंदर और फाइल का नाम है 01

play08:37

वेरिएबल तो जैसे मैंने इसको रन कर इसने

play08:39

कहा नहीं नहीं ऐसा तो नहीं हो सकता है

play08:41

असाइनमेंट अगर आप कांस्टेंट में देंगे तो

play08:44

मैं नहीं करूंगा तो obbvious सी बात है अब

play08:46

इसको कमेंट करना पड़ेगा यानी की दो

play08:48

स्लैशेस या फिर आप एक शॉर्टकट भी उसे कर

play08:51

सकते हैं कंट्रोल स्लैश और कमांड स्लैश तो

play08:53

इजीली कमेंट हो गया तो हमारी

play08:55

इन्वेस्टिगेशन इतनी तो कंप्लीट हो गई की

play08:57

अगर आप कंस के वर्ड लिख रहे हैं तो उसको

play08:58

आप चेंज नहीं कर सकते हैं ठीक है इतना तो

play09:01

नहीं कर सकते हैं एक कमेंट भी यहां पर लिख

play09:02

देते हैं की ये जो चीज है ये नॉट अलाउड है

play09:05

ठीक है जब भी यहां लिखते हैं तो अब क्या

play09:09

है की नोट जेएस आपकी उसे लाइन को नहीं

play09:12

पड़ेगा या फिर उसको एग्जीक्यूट नहीं करेगा

play09:14

लिख सकते हैं बट एग्जीक्यूट नहीं करेगा तो

play09:16

अभी मैंने अकाउंट आईडी यहां पे प्रिंट कर

play09:18

दो तो उसने कहा ठीक है ये भी आपके अकाउंट

play09:20

आईडी मैंने प्रिंट कर दी है हालांकि इससे

play09:22

अभी हम ये नहीं पता लगा की कैसे यूजर को

play09:24

रजिस्टर कराएंगे वो आएगा लेकिन अभी हम

play09:27

इतना ही शुरू करते हैं ठीक और चलते

play09:30

हैं की हम क्या करते हैं इस अकाउंट ईमेल

play09:33

के अंदर कोई दूसरी वैल्यू ऐड करके देखते

play09:35

हैं तो हमने लिखा

play09:37

क@c.com

play09:42

मॉडिफाई करके देख ले ताकि इन्वेस्टिगेशन

play09:44

हमारी जारी रहे यहां पे तो अकाउंट ईमेल हो

play09:47

गया है उसके बाद अकाउंट पासवर्ड हो गया है

play09:49

तो सपोज करिए पासवर्ड हमारा ए गया है इस

play09:51

बार

play09:52

21 21 जो भी पासवर्ड आप डालना चाहे और

play09:57

उसके बाद हमारे पास आया अकाउंट सिटी

play09:59

अकाउंट सिटी के अंदर हम यहां पे जयपुर से

play10:02

चेंज करके बैंगलोर चले जाते हैं अभी के

play10:04

लिए ठीक है अब ये सारी वेरिएबल प्रिंट

play10:08

करने के लिए प्रॉब्लम पता क्या है यहां

play10:10

जाना पड़ेगा फिर से लिखना पड़ेगा लोग फिर

play10:13

वो सजेशन में नहीं आएगा फिर से मैं

play10:15

लिखूंगा अच्छा सेकंड वाला सजेशन है फिर

play10:17

उसको सिलेक्ट करूंगा फिर लिखूंगा यहां पर

play10:19

अकाउंट ईमेल काफी कम है तो हम क्या करते

play10:23

हैं इसको थोड़ा सा चेंज करके देखते हैं की

play10:25

अकाउंट आईडी तो ठीक है ए गया इस बार उसे

play10:28

करते हैं काउंसिल का दूसरा मेथड जो की है

play10:30

टेबल यह बड़ा ही अच्छा और इंटरेस्टिंग

play10:32

मेथड इसके अंदर आप क्या कर सकते हो आप

play10:35

स्क्वायर ब्रैकेट लिख सकते हो यह हमने

play10:37

स्क्वायर ब्रैकेट स्टार्ट करो रे और उसके

play10:39

बाद आप सारे के सारे वैरियेबल्स का नाम एक

play10:41

साथ लिख सकते हो जैसे की मैंने लिख दिया

play10:43

यहां पे अकाउंट आईडी कॉम लगाकर लिख दिया

play10:45

है अकाउंट ईमेल फिर कॉम लगा के लिख दिया

play10:49

है अकाउंट पासवर्ड फिर कम ए लगा के लिख

play10:52

दिया है अकाउंट सेटिंग तो जैसे ही आप करते

play10:55

हैं अब आप जैसी फाइल को रन करेंगे तो आपको

play10:59

एक टेबुलर स्ट्रक्चर में सारे वैरियेबल्स

play11:01

यहां पे दिखने लग गए थोड़ा कंपेयर तू जो

play11:04

पहले हम कर रहे द कंसोल डॉट लॉक के साथ तो

play11:06

अकाउंट आईडी ए गया है ईमेल हमारा चेंज हो

play11:08

गया है और पासवर्ड भी चेंज हो गया है और

play11:11

सिटी भी चेंज हो गया है ठीक है इतनी बात

play11:13

तो ठीक है अच्छा अब यहां पर हम इसको

play11:16

इन्वेस्टिगेशन को थोड़ा सा आगे लेके जाके

play11:18

देखते हैं आपने लिखा लेट ठीक है एक

play11:21

वेरिएबल डिक्लेयर हो गया यानी की एक

play11:22

मेमोरी में स्पेस रिज़र्व होगी जो की मेरी

play11:24

वैल्यूज को वहां पर पुट कर रही है और उसको

play11:27

चेंज भी किया ए सकता है ठीक

play11:30

मेमोरी में जगह साइन हो गई है पर उसको भी

play11:33

मैं चेंज कर सकता हूं तो फिर डिफरेंस क्या

play11:35

है ये लेट उस क्यों करना है वॉर ही उसे कर

play11:37

लेते हैं सब जगह और हमने एक और चीज यहां

play11:39

पर देखी की अकाउंट्स के आगे तो मैंने नाम

play11:41

वॉर लिखा ना लेट लिखा ये कैसे प्रिंट हो

play11:44

गया है ये तो होना ही नहीं चाहिए था इसमें

play11:46

जयपुर कैसे ए गया और इसमें बेंगलुरु कैसे

play11:48

ए गया तो कहानी कुछ इस प्रकार से है की

play11:51

जावास्क्रिप्ट के अंदर आप वैरियेबल्स और

play11:54

कांस्टेंट को कुछ इस तरह से डिक्लेयर कर

play11:55

सकते हैं कांस्टेंट डिक्लेयर करने का एक

play11:57

ही तरीका है की आपको कॉस्ट कीवर्ड उसे

play11:58

करना है लेकिन वैरियेबल्स को डिक्लेयर

play12:01

करने का दो तरीके हैं एक है लेट और एक है

play12:03

वॉर अब हम क्या है वॉर उसे नहीं करते हैं

play12:05

क्यों इसके पीछे भी एक कहानी है

play12:07

जावास्क्रिप्ट जो लैंग्वेज है उसके अंदर

play12:09

एक छोटा सा प्रॉब्लम हुआ करता था प्रॉब्लम

play12:12

क्या होता था की इसको नहीं पता था स्कोप

play12:14

क्या है अब स्कोप की बात यहां पे हम और

play12:16

आगे जाके करेंगे अभी के लिए आपको बता देता

play12:18

हूं की ये जो आप कर्ली ब्रेसेज लिखते हो

play12:20

इसी को स्कोप बोला जाता है आगे जाकर हम और

play12:23

देखेंगे चीज की किस तरह से इसको बहुत जगह

play12:25

कम आता है जैसे आप लक उसे करेंगे देख नहीं

play12:28

है कर्ली ब्रेसेज यही आपका स्कोप है यह

play12:32

सिर्फ एल्स में नहीं आप जैसे फॉर उसे

play12:34

करेंगे

play12:38

स्कोप का एक प्रॉब्लम था की इनिशियल डेज़

play12:41

में

play12:41

कम ही नहीं करती थी ब्लॉक को नाम की चीज

play12:45

होती थी उसे पे इसका कोई कंट्रोल नहीं था

play12:48

तो प्रॉब्लम क्या होती थी की एक कोई

play12:50

प्रोग्रामर आया उसने लिखा अकाउंट पासवर्ड

play12:53

और उसने कोई वैल्यू ऐड कर दी उसके बाद कोई

play12:56

और प्रोग्राम आया उसने एक और फाइल लिखी

play12:58

उसके अंदर कोई कंडीशन लिखा फोर का उसमें

play13:01

भी गलती से एक अकाउंट पासवर्ड वेरिएबल को

play13:03

उसे कर लिया अब प्रॉब्लम क्या होती थी वो

play13:05

अकाउंट पासवर्ड नाम का जो वेरिएबल है वो

play13:07

ये वाला चेंज हो जाता जो सब जगह लिखा हुआ

play13:09

है अब किसी ने अगर मैन लीजिए नाम वेरिएबल

play13:12

10 जगह उसे कर रखा है तो 10 जगह चेंज हो

play13:14

जाता था तो बहुत प्रॉब्लम होती थी

play13:17

कुछ एडवांस पार्ट शायद उन्होंने कहा देखो

play13:20

ऐसा है की इस वॉर के अंदर तो इसको वाला

play13:22

बड़ा प्रॉब्लम है तो हम क्या करेंगे आज के

play13:24

बाद हम उसे करेंगे सिंपली सिर्फ लेट

play13:26

लेट के अंदर यह जो स्कोप वाला प्रॉब्लम आप

play13:29

सभी को ए रहा है यह हमने दूर कर दिया तो

play13:31

अभी से हम जितने भी आप अभी मॉडर्न

play13:33

ट्यूटोरियल देखेंगे वह आपको दो ही चीज

play13:35

बोलेंगे की जावास्क्रिप्ट में अगर आपको कम

play13:36

करना है तो कॉन्स्टिट्यूशन करिए और लेट

play13:39

उसे करिए और भूल जाइए वॉर भी कुछ होता था

play13:41

अब ऐसा नहीं है की टोटली रिमूव कर दिया

play13:44

हमने को कुछ लोग और कुछ जो ओल्ड कोड है वो

play13:46

वहां पे अभी भी उसे करते हैं बट मैं तो

play13:48

आपको यहां पे एक अच्छा सा नोट लिख के

play13:50

दूंगा एक नए टाइप के कमेंट्स के अंदर की

play13:52

प्लीज प्लीज वॉर को कभी मत उसे कीजिए तो

play13:55

एक नए टाइप का कमेंट सीखने के लिए आप

play13:57

स्लैश लिखिए और स्टार लिख दीजिए और वापस

play13:59

से स्टार लिखी और स्लैश लिखिए अब इसके बीच

play14:02

में जो भी आप लिखेंगे वो भी एक कमेंट है

play14:04

तो देखा कितनी जल्दी हमने एक ही वीडियो

play14:06

में और लेट कांस्टेंट ब्लॉक की कहानी और

play14:09

ये सारी सिख ली क्यों क्योंकि हमें सीखना

play14:11

था एक्सपीरियंस के साथ प्लस प्रोजेक्ट

play14:13

ओरिएंटेड क्या बनाना है वो भी तो सीखना है

play14:15

तो यहां पे मैं आपके लिए एक नोट लिख देता

play14:18

हूं प्रेफर नॉट तू उसे वॉर अभी क्यों करें

play14:24

बिकॉज ऑफ इशू इन ब्लॉक स्कोप एंड फंक्शनल

play14:31

स्कोप

play14:34

तो यह फंक्शनल स्कोप

play14:37

के सीरीज इसके बारे में भी डिटेल में बात

play14:40

करेंगे बट अभी आपके लिए यहां पे एक नोट्स

play14:42

वैरायटी है तो samrize करते हैं इसको बहुत

play14:44

इजी है और लेट आपको उसे करने हैं और आपको

play14:47

उसे नहीं करना है बट एक छोटी सी कहानी तो

play14:49

रहेगी जावा स्क्रिप्ट के अंदर

play14:51

जावास्क्रिप्ट क्योंकि सेफ लैंग्वेज है की

play14:55

आपको कई बार बिना वेरिएबल के आगे कुछ भी

play14:57

लिखे हुए आप एक वेरिएबल की मेमोरी रेसर कर

play15:00

सकते हो हालांकि ये तरीका बिल्कुल अच्छा

play15:02

नहीं बिल्कुल आपको उसे नहीं करना चाहिए बट

play15:04

ध्यान रखें की ऐसा भी हो सकता है

play15:07

पॉसिबिलिटी है की एक वेरिएबल इस तरह से भी

play15:09

डिक्लेयर हो सकता है अच्छा एक चीज तो हमने

play15:11

यहां पे कारी नहीं हम समरिज तो करने वाले

play15:13

द एक चीज तो हमने यहां पर देखी नहीं क्या

play15:16

हो किले देखिए अगर मुझे एक और नया आया

play15:18

मेरे पास चैलेंज मेरे बॉस ने मुझे कहा की

play15:21

मेरे क्लाइंट ने मुझे कहा की मुझे तो

play15:23

अकाउंट्स स्टेट भी लेना है लेकिन अभी मुझे

play15:25

पता नहीं डिफॉल्ट स्टेट क्या है तो आप

play15:27

मुझे पता लग गया की लेट या कांस्टेबल उसे

play15:28

करना है कांस्टेंट क्योंकि स्टेट चेंज हो

play15:30

सकते हैं तो लेट उसे करता हूं और मैंने

play15:32

डाला अकाउंट स्टेट एक नया वेरिएबल

play15:35

डिक्लेयर कर दिया बट मैं इसमें कोई वैल्यू

play15:36

असाइन नहीं कर रहा हूं इक्वल तू नहीं दल

play15:38

रहा हूं

play15:41

लगाइए नहीं लगाइए आपकी मर्जी है कोई फर्क

play15:44

नहीं पड़ता है से किया अब इस अकाउंट स्टेट

play15:47

को मैं प्रिंट कर के देखता हूं की यहां पे

play15:49

किस तरह से ए रहा है तो मैं यहां पर लिखता

play15:51

हूं अकाउंट स्टेट और ये मैंने लिख दिया

play15:53

ठीक है अब लिख तो दिया है अब गैस करिए

play15:57

इसकी वैल्यू क्या होगी यही तो होती

play15:58

इन्वेस्टिगेशन वाली पढ़ तो हमने लिखा यहां

play16:01

पे और इसको रन कराया तो हमें पता लगा की

play16:03

जो फोर्थ वैल्यू है वो है अंडे फाइंड तो

play16:06

ये भी पता लग गया की अगर जावास्क्रिप्ट के

play16:08

अंदर आप वेरिएबल डिक्लेयर करके छोड़ देते

play16:10

हैं उसकी वैल्यू कुछ नहीं लगाते हैं तो

play16:11

जाओ स्क्रिप्ट उसको उन डिफाइंड मानती है

play16:13

ठीक भी वर्ड अभी तक डिफाइन नहीं हुई है

play16:16

वैल्यू तो इतना कुछ परिसर है ही नहीं तो

play16:18

देखा इतना सिंपल है जावास्क्रिप्ट अगर आप

play16:21

इन्वेस्टिगेशन तरीके से पढ़ते हैं तो आगे

play16:24

भी इसी तरह से और पढ़ करेंगे

play16:25

इन्वेस्टिगेशन तरीके से और हम धीरे-धीरे

play16:31

करना चाहते हैं और उसी के लिए हम सिख रहे

play16:34

हैं तो मिलते हैं अगले वीडियो में उम्मीद

play16:36

आप सभी ने सब्सक्राइब कर दिया होगा अगले

play16:37

वीडियो का इंतजार करिए बहुत जल्दी आता हूं

Rate This

5.0 / 5 (0 votes)

您是否需要英文摘要?