Why string to number conversion is confusing | chai aur #javascript

Chai aur Code
17 Jan 202315:00

Summary

TLDRThe video script discusses various concepts related to operations and type conversion in JavaScript. It emphasizes the importance of understanding how different data types interact and convert during operations, such as the behavior of strings and numbers when added together. The script also touches on the significance of individual contributions to a series, urging viewers to subscribe and share on LinkedIn for motivation. It delves into examples like increment operators and the challenges they present, advocating for clean and readable code to ensure maintainability and understanding by others.

Takeaways

  • 😀 The video script is in Hindi and discusses the importance of subscribing and sharing the series for motivation.
  • 📚 It covers the basics of operations and conversions in programming, emphasizing the simplicity of operations like 2 + 2.
  • 🔍 The script touches on the concept of value assignments and how to handle negative values in programming.
  • 📝 It explains the use of comments in code with control slash to ensure only operations are focused on after them.
  • 👀 The video aims to discuss important operations and their reasoning behind them, rather than every single detail.
  • 🔢 The script mentions the intricacies of number and string conversions, and how they behave differently based on their order in expressions.
  • 💬 It highlights the importance of understanding the reasoning behind operations and their solutions for better comprehension.
  • 🔄 The discussion includes special type conversions and tricky conversions, suggesting further research for those interested.
  • 🛠️ The script advises against writing confusing code and emphasizes the importance of readability and simplicity in programming.
  • 🔄 It explains how different values are treated during operations, especially when it comes to increment and decrement operators.
  • 🔗 The video ends with a reminder to share the video and subscribe, promising clearer concepts as the project progresses.

Q & A

  • What is the primary motivation mentioned in the script for viewers to share the series on LinkedIn?

    -The script suggests that the primary motivation for viewers to share the series on LinkedIn is to provide the creators with motivation, as they are deeply involved in the series and want to ensure that people who are watching are also appreciating and sharing it.

  • What is the basic concept of 'Operations' discussed in the script?

    -The script explains 'Operations' as a simple concept, exemplified by the operation of adding two strings together or performing arithmetic operations like 2 + 2.

  • What does the script imply about the necessity of individual contributions in the series?

    -The script emphasizes the importance of individual contributions, suggesting that they are crucial and asking viewers to share the series on LinkedIn to show their support.

  • What is the script's stance on the depth of the content covered in the series?

    -The script indicates that the series goes into great depth, implying that a single share on LinkedIn can make a difference in acknowledging the effort put into the content.

  • How does the script address the concept of 'value' in the context of operations?

    -The script discusses 'value' in terms of assigning values within operations, such as assigning a negative value and what it means in the context of the operation being performed.

  • What is the script's advice on writing code for practical applications?

    -The script advises against writing confusing code and emphasizes the importance of writing clean, simple, and readable code, especially in a professional or corporate setting.

  • What is the script's perspective on the importance of understanding the underlying reasons behind operations?

    -The script suggests that while understanding the underlying reasons ('the region') and solutions behind operations is important, it may not be necessary for everyone, especially if they are not building their own engine or implementing browser features.

  • How does the script handle the concept of 'Conversion' in the context of operations?

    -The script touches on 'Conversion' by explaining how different types of values are treated during operations, such as treating all values as strings or numbers depending on their position in the operation.

  • What is the script's view on the importance of sharing individual contributions on social platforms like LinkedIn?

    -The script views sharing individual contributions on platforms like LinkedIn as very important, as it provides motivation to the creators who are deeply involved in the series.

  • How does the script discuss the concept of 'increment' in operations?

    -The script discusses 'increment' in operations by providing examples of how values are increased, such as using the increment operator with variables like 'game counter'.

  • What is the script's advice regarding the use of parentheses in operations?

    -The script advises on the importance of understanding operator precedence and using parentheses to ensure that operations are performed in the intended order.

Outlines

00:00

📝 Introduction to Operations and Conversions

The speaker begins by addressing the audience and encouraging them to subscribe and share the series if they haven't already, emphasizing the importance of individual contributions. The main topic of discussion is operations, starting with the basics such as string concatenation and number operations, and moving on to more complex topics like value assignments and negative values. The speaker clarifies that there's no need for the audience to understand every detail deeply but assures that important concepts will be discussed in depth, including their reasons and solutions. The summary also touches on the importance of sharing the content on LinkedIn for motivation.

05:02

🔢 Exploring JavaScript Type Conversions and Operator Behavior

This paragraph delves into the intricacies of JavaScript type conversions and operator behavior, particularly focusing on how different types are treated when used in operations. The speaker explains that while some conversions happen automatically, understanding the rules and guidelines is crucial, especially when writing code that might be reviewed or used by others. The summary covers the concept of primitive type conversions, the importance of writing clean and understandable code, and the potential confusion that can arise from improper use of operators and type conversions. It also mentions the importance of adhering to guidelines when performing conversions to avoid confusion and ensure code quality.

10:03

👨‍🏫 Advanced JavaScript Concepts and Code Readability

The final paragraph discusses advanced JavaScript concepts such as operator precedence and the use of assignment operators. The speaker warns against writing confusing code and emphasizes the importance of readability and consistency. The summary highlights the potential pitfalls of using certain coding tricks and behaviors that may not be understood by others in a team setting. It also touches on the importance of understanding increment and decrement operators, and the need to study documentation for a deeper understanding of these concepts. The speaker encourages the audience to share the video and subscribe for more content.

Mindmap

Keywords

💡Contribution

The term 'contribution' refers to the act of giving or adding something, often to a collective effort or cause. In the context of the video, it is used to encourage viewers to share the video on LinkedIn, thereby contributing to the spread of the content and increasing its reach. This is a call to action to engage with the content and support the creator by sharing it with their network.

💡Operation

In the video, 'operation' is used to describe a process or action performed on data, such as mathematical operations or string manipulations. It is a fundamental concept in programming and computer science, where operations are executed on variables or values to produce a result. For example, the script mentions '2 + 2' as an operation that results in the value '4', illustrating the basic concept of operations in the context of the video's theme.

💡Primitive

A 'primitive' in programming refers to a data type that is provided by the language and is不可trivially constructed from other types. In the video, the term is used in the context of type conversion, where the script discusses converting from a primitive type to another, such as converting numbers to strings or vice versa. This is an essential concept in the video's discussion of operations and data manipulation.

💡Type Conversion

Type conversion, also known as type casting, is the process of converting a value from one data type to another. The video script discusses this concept in the context of JavaScript, where certain operations may implicitly convert types to perform the desired operation. For instance, adding a number to a string might convert the number to a string to create a concatenated result.

💡Increment

The 'increment' operator in programming is used to increase a variable's value by one. The video script mentions the increment operator as part of a discussion on operators and how they affect the value of variables. For example, using '++' before a variable (prefix increment) or after it (postfix increment) changes the variable's value, illustrating the concept of variable manipulation through operations.

💡Syntax

Syntax refers to the set of rules that defines how to structure statements written in a programming language. The video script touches on syntax in the context of understanding how to write code correctly. It emphasizes the importance of clear and readable syntax for effective communication within the code, especially when discussing complex operations and constructs.

💡Parenthesis

In the script, 'parenthesis' is used to discuss the order of operations in expressions, which is crucial for determining the outcome of calculations. The video mentions that not using parenthesis where needed can lead to confusion and incorrect results, highlighting the importance of this syntax element in ensuring the correct execution of operations.

💡Boolean

A 'Boolean' is a data type that can only have two values: 'true' or 'false'. In the video, Boolean values are discussed in the context of conditional statements and logical operations. The script mentions that certain operations may implicitly convert non-Boolean values to Boolean, affecting the flow of the program based on the truthiness or falsiness of the values.

💡String

A 'string' is a sequence of characters used in programming to represent text. The video script discusses strings in the context of operations that can be performed on them, such as concatenation and type conversion. For example, the script talks about adding strings together to form a new string, which is a common operation in many programming tasks.

💡Variable

A 'variable' is a storage location paired with an associated symbolic name, which contains some known or unknown quantity or information, a value. In the video, variables are used to store and manipulate data. The script gives examples of how variables are assigned values and how operations can be performed on these variables, which is central to the video's theme of programming concepts.

Highlights

Introduction to the importance of subscribing and sharing the series for motivation.

Explanation of basic conversions like numbers to booleans and strings.

Discussion on operations, starting with a simple example of 2 + 2.

Clarification that understanding the depth of operations is not necessary for everyone.

The concept of assigning negative values and the impact on output.

Use of control slash for commenting out code.

Demonstration of how values are assigned and the output expected.

The automatic conversion of values and its implications in programming.

Misunderstandings that can arise from the automatic conversion of values.

The behavior of JavaScript when concatenating strings and numbers.

Guidelines on when to use parentheses for clarity in code.

The difference between prefix and postfix operators in JavaScript.

Common mistakes made with increment operators and how to avoid them.

The importance of code readability and maintainability in professional settings.

How to handle special cases of type conversion in JavaScript.

The significance of operator precedence and how it affects code execution.

Tips on writing clean and understandable code, avoiding confusing patterns.

Conclusion emphasizing the importance of sharing the video and subscribing for more.

Transcripts

play00:00

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

play00:02

में सबसे पहले उम्मीद करता हूं अगर आप इस

play00:05

सीरीज को देख रहे हैं अभी तक सब्सक्राइब

play00:06

भी नहीं किया एक बार भी लिंक्डइन पर शेयर

play00:08

नहीं किया है तो हमें मोटिवेशन कहां से

play00:11

आएगा की लोग बजे सीरीज को देख रहे हैं

play00:13

अप्रिशिएट कर रहे हैं देखिए एक-एक

play00:15

इंडिविजुअल कंट्रीब्यूशन जो है ना बहुत

play00:17

जरूरी होता है तो प्लीज फटाफट शेयर करिए

play00:19

लिंकन पे क्योंकि हम इतना डेप्थ में जा

play00:21

रहे हैं तो एक शेयर तो बनता है तो अभी हम

play00:24

इस वीडियो के अंदर बात करेंगे ऑपरेशंस के

play00:26

बारे में तो अभी देखिए कन्वर्जन तो हमने

play00:28

देख लिया की नंबर से बुलियन बोलियां से

play00:30

नंबर्स नंबर से स्ट्रिंग जहां पे भी हम कर

play00:32

सकते हैं बेसिक इतना ही कन्वर्जन आपको

play00:34

जानने की जरूरत है ऐसा नहीं है की आपको

play00:36

इसके अंदर एचडी करनी है नहीं अभी नहीं

play00:38

करनी है अभी हम देखेंगे ऑपरेशंस तो ये

play00:40

ऑपरेशंस क्या चीज है बहुत ही आसान है 2 +

play00:43

2 और हो गया एक ऑपरेशन है

play00:47

ऑपरेशन है दो स्ट्रिंग थी जोड़ दिया एक

play00:50

ऑपरेशन है तो इसी तरह का ऑपरेशन है अब कुछ

play00:53

ऑपरेशंस में स्किप करूंगा सिर्फ उनको टच

play00:55

करूंगा लेकिन जो इंपॉर्टेंट वैन है उसे पर

play00:57

हम बात करेंगे डिस्कस करेंगे और जितने भी

play00:59

नेम्स है वह सब आपको समझ में आने लगेंगे

play01:01

की एक्चुअली में उनके पीछे रीजन क्या है

play01:03

उनका सॉल्यूशन क्या है किस तरह से कम होता

play01:05

है तो सबसे पहले हम ऑपरेशंस के बारे में

play01:07

बात करते हैं जैसे की आपके पास एक वैल्यू

play01:10

है तो आपने वैल्यू ली यहां पे थ्री और

play01:12

आपने जब उसका कंसों लॉक किया तो आपने कहा

play01:15

की वैल्यू की जगह मैं उसकी क्या करता हूं

play01:16

या फिर कौन से लोग से पहले ही लेट नग

play01:20

वैल्यू नेगेटिव वैल्यू तो आपने क्या कर

play01:23

उसको असाइन कर दिया की मुझे नेगेटिव ऑफ

play01:26

वैल्यू दो तो obbvious सी बात है इसमें

play01:27

कोई डिफिकल्ट चीज नहीं है ये सब आप लोग

play01:29

गैस कर सकते हैं की नेक वैल्यू के अंदर

play01:31

क्या वैल्यू असाइन होगी या फिर क्या उसके

play01:34

अंदर आउटपुट आएगा तो हम क्या करते हैं इन

play01:36

दोनों लाइन को सिलेक्ट करते हैं कंट्रोल

play01:37

स्लैश कर देते हैं ताकि कमेंट हो जाए बाकी

play01:39

सब और कुछ प्रिंट नहीं हो रहा है तो हमारा

play01:42

जो ध्यान है वो ऑपरेशंस के बाद ही रहे तो

play01:44

ठीक है इसको हम रन करके देखते हैं हमने

play01:46

कहा की नोड हमारे 01 फोल्डर के अंदर से

play01:50

वही 035 है 03 तो क्या वैल्यू आई अब ठीक

play01:54

है इसमें कुछ भी परिसर नहीं था की यहां पे

play01:56

हमारे पास -3 ए गया क्यों ए गया नेगेटिव

play01:59

वैल्यू अपने

play02:05

[संगीत]

play02:59

अगर आपने 11 12 किया है तो इनके बारे में

play03:02

डिस्कशन ज्यादा इंपॉर्टेंट नहीं है

play03:04

हालांकि रिमाइंडर जो है यहां पर जो मॉडल्स

play03:07

है रिमाइंडर है इसका काफी उसे है

play03:08

क्रिप्टोग्राफी में बहुत सारी algoridams

play03:11

में तो वो और ज्यादा डिटेल में जब हम चैनल

play03:13

पे जाएंगे तो उसके बारे में हम देख लेंगे

play03:14

अच्छा यहां पे कुछ है ना ट्रिकी चीज भी

play03:17

होती है उनके बारे में हम डिस्कस करते हैं

play03:18

जैसे की फॉर एग्जांपल आपने कहा की जो स्तर

play03:23

वैन है उसके अंदर आपने लिखा सिंपली हेलो

play03:27

या फिर हितेश हेलो ही लिख लेते हैं तो ये

play03:30

आपने लिखा हेलो और स्तर 2 के अंदर आपने

play03:34

लिखा हितेश और हितेश लिखने से पहले या तो

play03:38

यहां पे एक स्पेस दे दीजिए ताकि जो आप

play03:39

जोड़े तो स्ट्रिंग एक साथ नहा जाए उसके

play03:41

बीच में स्पेस आए तो इन दोनों का जो आपको

play03:43

जोड़ना है तो कुछ परिसर नहीं है तो आप

play03:46

क्या कर सकते हैं स्तर 3 ले सकते हैं और

play03:48

उसके अंदर बोल सकते हैं की जो स्तर वैन है

play03:49

उसको ऐड कर दो str2 से सब्सट्रैक्ट नहीं

play03:52

होता है सिर्फ

play03:54

कौन सा लॉक करेंगे तो सिंपल सी चीज है

play03:57

इसमें कोई परिसर बात नहीं है की जब आप

play03:58

स्तर 3 की वैल्यू देखेंगे सके तो बहुत

play04:00

आसान है उसे वैल्यू के अंदर क्या आएगा आप

play04:02

सभी लोग गैस कर सकते हैं इतना कोई

play04:04

डिफिकल्ट था ही नहीं हेलो हितेश तो ठीक है

play04:06

ये तो हो गया हमारा बेसिक की इस तरह से

play04:08

स्ट्रिंग्स भी जोड़ी जा सकती है लेकिन पता

play04:10

है प्रॉब्लम कहां आती है कुछ यहां पर

play04:14

प्रॉब्लम आती है जैसे आपने consonal लॉक

play04:15

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

play04:18

वैल्यू है वैन इसके साथ ऐड कर दीजिए 2 तब

play04:22

एक प्रॉब्लम आया या फिर आपने इसी का उल्टा

play04:25

कर दिया की यहां पे लिया वैन और जो तू है

play04:27

वो वहां पे आपने दे दिया स्ट्रिंग अब

play04:30

वैल्यू क्या आएगी ये होती है परिसर

play04:32

सिचुएशन इसके बारे में हम करेंगे

play04:33

प्रॉपर्ली डेस्क तो आप जब इसको आउटपुट

play04:36

देते हैं तो आपने देखा यहां पे भी 12 है

play04:39

यहां पे भी 12 है अच्छा ये कैसे हुआ इतनी

play04:43

स्मार्ट कैसे हो गई की उसने ऑटोमेटिक कर

play04:45

दिया और मुझे उसका सबमिशन भी दे दिया

play04:47

अच्छा ये तो हो गया जब तक तो ठीक था लेकिन

play04:50

क्या हो की अगर मैं इस वैन को बना डन एक

play04:54

स्ट्रिंग

play04:56

और दोनों स्ट्रिंग होगी

play04:59

जैसे यहां पे आया लेकिन यहां पे तो आना

play05:02

चाहिए था थ्री यहां पे भी इस तरह से ठीक

play05:04

है तो अब एक चीज इंपॉर्टेंट देखिए अब क्या

play05:07

होता है की अगर मैं इसको लिखता हूं 1 + 2

play05:09

इसका आउटपुट ऑलरेडी देख चुके हैं 12 आता

play05:11

है दोनों इसको साइड बाय साइड कर देते हैं

play05:12

कोई कन्वर्जन नहीं होता है लेकिन क्या हुआ

play05:15

अगर मैं ये करूं तो अब इंटरेस्टिंग आता है

play05:18

तो अब इसका हम बिहेवियर देखते हैं तो इसने

play05:22

कहा 12 और 2 ठीक है तो इसका वैल्यू ए गया

play05:26

हमारे पास 122 हमने तो सोचा था की शायद

play05:29

इसको पहले ऐड कर दिया जाएगा फोर और 14

play05:31

वैल्यू आएगा बट नहीं यहां पे तो सारा

play05:33

कन्वर्जन ही स्ट्रिंग के अंदर हो गया है

play05:34

ठीक है ये भी हो एक चीज है लेकिन

play05:38

जब इसका उल्टा करते हैं तब कुछ डिफिकल्ट

play05:41

और कुछ डिफरेंट आपको मिलता है जैसे की

play05:45

हान यहां पर मेरे को पता है अभी थोड़ा सा

play05:47

कन्फ्यूजन ए रहा है की क्या होगा अब इसका

play05:49

अगर कोई आपसे आउटपुट पूछ लेगा लास्ट लाइन

play05:51

का तो आप obbvious सी बात है कंफ्यूज हो

play05:52

जाएंगे की इसका आउटपुट ये कैसे आया की

play05:55

यहां पे तो यह 3 और 2 ऐड हो गए और थ्री ए

play05:58

गया और इसके साथ साइड बाय साइड हमने उसको

play06:01

अटैच करके लिख दिया तो थ्री और तू 32 इंच

play06:03

जैसा दिख रहा है हमें और यहां पे जो ये

play06:06

वैन आया यहां पे कुछ भी कन्वर्जन नहीं हुआ

play06:08

तो ये सब एक्चुअली में होता कैसे है अब

play06:10

इसको चाहे आप रूल माने चाहे आप उसको

play06:12

गाइडलाइन माने ये सब जो ड्राइव होता है वो

play06:15

इस लिंक से होता है तो यहां पे आप

play06:18

ekmascript की जब गाइडलाइंस पर जाएंगे तो

play06:20

जब भी आपको तू प्रिमिटिव यानी की कन्वर्ट

play06:22

करना है किसी को भी प्रेफर टाइप में तो ये

play06:24

कुछ गाइडलाइन से जो फॉलो करती है तो यहां

play06:27

पे लिखा हुआ है एब्स्ट्रेक्ट ऑपरेशन तू

play06:28

प्रिमिटिव टैक्स इनपुट और उसके बाद प्रेफर

play06:31

टाइप स्ट्रिंग या नंबर हम डिसाइड करते हैं

play06:33

की किस्म कन्वर्जन होना चाहिए या फिर कौन

play06:36

सी वैल्यू पहले ए रही है अब इसके अंदर में

play06:38

ज्यादा डिटेल में नहीं जाऊंगा क्योंकि अभी

play06:40

आपको जाने की भी जरूरत नहीं है ये थोड़ा

play06:42

सा और रिसर्च टॉपिक है स्पेशली जब आप

play06:45

कुछ खुद का इंजन बना रहे हैं यह आपको एक

play06:47

ब्राउज़र इंप्लीमेंटेशन करना है तब आपको

play06:48

यहां पे आता है और एक पुराना वीडियो भी

play06:51

मैंने इसके अंदर दिया था जहां पे मैंने

play06:52

पूरा आधा घंटा इसके अंदर डिस्कस किया था

play06:54

की किस तरह से यह इनपुट वैल्यूज है वह

play06:55

वीडियो भी मैं डिस्क्रिप्शन में लिंक में

play06:57

दे दूंगा या फिर इस फाइल के अंदर यह ऐड कर

play06:59

दूंगा तो यहां पे आप देख सकते हैं जब आपका

play07:01

इनपुट ऑब्जेक्ट हो और आपको किस में

play07:03

कन्वर्ट करना हो तब क्या होता है डिफाल्टर

play07:05

स्ट्रिंग यहां तक की उनकी एल्गोरिथम भी

play07:06

लिख राखी है की आपको तू बोलियां में

play07:08

कन्वर्ट करना और तू नंबर में तो क्या-क्या

play07:10

उसके अंदर वैल्यूज होती है किस तरह से वो

play07:12

कन्वर्जन होता है तो ये सारा डिटेल्स

play07:14

स्पेसिफिकेशन यहां पे है ऑलरेडी एक वीडियो

play07:16

में मैंने काफी डिटेल में उसको डिस्कस कर

play07:18

रखा है ये बात अलग है की वो इंग्लिश में

play07:20

है तो अभी आपको डिटेल में जाने की जरूरत

play07:22

नहीं है बस इतना ध्यान रखिए की जब भी जाओ

play07:25

फ्रूट का कन्वर्जन हो तो स्पेसिफिकली इस

play07:28

तरह की केस में तो आप प्लीज इन पे

play07:30

डिपेंडेंट मत रहिए आपने बहुत सारे ऐसे भी

play07:33

एग्जांपल देखे होंगे जो की लिखते हैं की

play07:35

थ्री प्लस फोर मल्टीप्लाई बाय फाइव मॉडल्स

play07:40

बाय थ्री स्काउट पुट के आएगा देखिए ये

play07:43

सारे के सारे जो है इस तरह के वैल्यूज है

play07:46

यह क्वेश्चंस के लिए ठीक है एग्जाम्स के

play07:49

लिए ठीक है की आप इस तरह का आउटपुट दे रहे

play07:50

हैं बट अगर रियल लाइफ सिचुएशन में आप ऐसा

play07:52

कोड लिखते हैं तो आपको एक सिंगल आदमी भी

play07:54

अप्रिशिएट नहीं करेगा क्यों लिखना है

play07:57

कन्फ्यूजन को अगर आपको कुछ वैल्यूज पे ही

play07:59

डिफाइन करना है तो आप और पेरेंटी से उसे

play08:01

करिए ना की ताकि मुझे फर्स्ट इसका आउटपुट

play08:04

चाहिए उसके बाद जो वैल्यू आता है उससे

play08:05

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

play08:07

आप उसे क्यों नहीं कर रहे हैं तो प्लीज ये

play08:10

जो क्वेश्चन वाला माइंड सेट है की मुझे

play08:12

सिर्फ क्वेश्चंस सॉल्व करना है एग्जाम में

play08:13

आना ठीक है वो भी जरूरी है लेकिन वो

play08:16

प्रैक्टिकल उसे नहीं होता है कहीं पे भी

play08:18

इस तरह की वैल्यूज अगर आप लिख रहे हैं या

play08:20

कोड लिख रहे हैं आपका कोड रिव्यू होगा ही

play08:22

नहीं वहां पर मतलब आपकी जो पुल रिक्वेस्ट

play08:25

है मर्ज ही नहीं होगी और बड़े कॉर्पोरेट

play08:26

में मर्ज हो ना एक कॉमन चीज है आप गूगल

play08:29

में कम कर रहे हैं कहीं भी कम करें इस तरह

play08:30

का कोड आपके पास वापस भेज दिया जाएगा की

play08:33

प्लीज अपना कोड ठीक करिए ये बिल्कुल सही

play08:35

तरीका नहीं है दोबारा से कोड लिखिए या फिर

play08:37

हो सकता है क्वेश्चन भी का रहा है की कहां

play08:38

से सिख क्या है इस तरह का मेस्सी कोड

play08:40

लिखना तो प्लीज प्लीज एक हम्बल रिक्वेस्ट

play08:43

है इसका ध्यान रखना जिनका और आसान है यह

play08:45

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

play08:47

देखिए या फिर इंग्लिश चैनल वाला वीडियो

play08:49

देख लीजिए अभी के लिए सभी के लिए आपको

play08:51

सिर्फ इतना ही जानना है की इस तरह का

play08:53

जावास्क्रिप्ट के अंदर कन्वर्जन होता है

play08:54

अगर स्ट्रिंग फर्स्ट है तो सभी को

play08:56

स्ट्रिंग में ट्रीट किया जाएगा और अगर

play08:58

स्ट्रिंग लास्ट में है तो पहले जो

play09:00

कन्वर्जन है वो हो जाएगा इसका रीजन वहां

play09:02

पे है तो ये तो वो हमारा बेसिक अब इसी तरह

play09:05

से और भी कन्वर्जन होते हैं कुछ स्पेशल

play09:07

टाइप के कन्वर्जन वो भी मैं आपको बताता

play09:09

हूं

play09:09

ट्रिकी कन्वर्जन जिनको बोलते हैं तो हमने

play09:11

कंसल्ट लिखा अब obbvious सी बात है यहां

play09:14

पे अगर आप ट्रू की वैल्यू आप प्रिंट करना

play09:16

चाहेंगे तो क्या प्रिंट आएगा सबसे पहले

play09:17

मैं इन सारे कंसों लॉक को हटा देता हूं की

play09:20

इनका कम तो हो गया है अब देखते हैं की कौन

play09:23

सा लॉक में जब मैं ट्रू प्रिंट करता हूं

play09:24

तो क्या वैल्यू प्रिंट होती है obbvious

play09:26

सी बात है ट्रू ही प्रिंट होगा लेकिन आप

play09:28

देखेंगे की कुछ इस तरह की वैल्यूज भी होती

play09:30

है जहां पे आप इसको प्लस तू लिख देते हैं

play09:33

अब ये कोड लिखना सबसे खराब बात है क्योंकि

play09:37

आप कन्फ्यूजन कोड लिखना चाहते हो कोर्ट

play09:39

क्लीन होना चाहिए सिंपल होना चाहिए रीडेबल

play09:41

होना चाहिए यहां पर कोई गेम थोड़ी ना चल

play09:43

रहा है की पहेली पूछो कोर्ट सिंपल होना

play09:46

चाहिए लेकिन जब इस तरह का कोड लिखते हैं

play09:48

तो वैल्यू देखकर आपको सरप्राइज होगा की वो

play09:50

वैन होगा क्योंकि ओबवियस सी बात है ट्रू

play09:52

अपने आप में बोलियां है अभी उसका कन्वर्जन

play09:54

होना है क्योंकि आपने उसमें इंक्रीमेंट

play09:55

किया है तो इंक्रीमेंट तो हुआ नहीं बट

play09:57

आपका वैल्यूज ए गया है इसी तरह से आप शायद

play10:01

सोच रहे होंगे की इसका आउटपुट क्या आएगा

play10:02

तो वो भी मैं आपको दिखा देता हूं की यहां

play10:05

पे ऑलरेडी इसमें एरर दे दिया है की ये

play10:06

एक्सपेक्टेड नहीं था अगर आप इसको रन भी

play10:08

करेंगे तो आप कहेंगे की ये क्या कर रहे हो

play10:11

बट प्लस ट्रू वहां पे पॉसिबल है इसी तरह

play10:14

से आपको दिखेगा मैं यहां पे लिख के छोड़

play10:16

देता हूं आपके लिए +2 इसी तरह से आपको

play10:19

दिखेगा की कई बार कुछ लोग लिख देते हैं

play10:20

प्लस और मत पर रख दीजिए अब हम ऑलरेडी देख

play10:24

चुके हैं की एम्टी परंथेसिस को जब आप

play10:25

बुलियन वैल्यूज में इनमें कन्वर्ट करते

play10:27

हैं तो जीरो आता है प्लस लिखने से वो

play10:28

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

play10:31

ट्रिकी कन्वर्जन है बट नहीं करना चाहिए

play10:33

नहीं करना चाहिए इससे किसी का कोई सेंस

play10:36

नहीं है कोई वैल्यूज नहीं है ऑपरेटर

play10:38

प्रेसीडेंसी पढ़ना चाहिए की किसका

play10:39

प्रायोरिटी पहले आता है लेकिन वो सिर्फ

play10:41

एग्जाम के लिए अगर प्रोडक्शन में आप जा

play10:43

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

play10:44

वहां यहां पर दूसरा कम होता है अच्छा एक

play10:47

चीज और आपको मैं बताता हूं यहां पे कुछ

play10:49

असाइनमेंट ऑपरेटर के रिगार्डिंग

play10:50

इंटरेस्टिंग हालांकि मैं इसको प्रेफर नहीं

play10:52

करता हूं की कोई भी इस तरह का कन्वर्जन

play10:54

करें या कोई भी इस तरह का ऑपरेशन भी करें

play10:56

लेकिन एक ऑपरेशन यहां पर आपको दिखेगा कई

play10:59

बार कई जगह किया जाता है जैसे आपने लिया

play11:01

वैल्यू तो आपने लिखा नाम अन वैन और लिखा

play11:06

नाम 2 और लिखा नाम थ्री अब कई बार क्या

play11:10

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

play11:13

का तो आप लिख देते हैं नंबर इसका वैल्यू

play11:16

भी इक्वल तू है नाम तू और इसका वैल्यू है

play11:20

नाम थ्री के इक्वल और जिनका साइन मैन कुछ

play11:23

हम करेंगे तू प्लस तू से हालांकि इस तरह

play11:26

के भी कोड को मैं कुछ खास वैल्यू नहीं

play11:28

देता हूं क्योंकि पहली बात तो यहां पे

play11:30

कंसिस्टेंसी नहीं है अगर कंसिस्टेंसी है

play11:32

तो क्यों लिखना इतना कन्फ्यूजन कोड अगर

play11:34

आपको सारे वैल्यूज में साइन ए की वैल्यू

play11:36

करनी थी अब पता है मुझे की नंबर वैन के

play11:39

अंदर भी फोर है एन तू के अंदर भी फोर है

play11:41

थ्री के अंदर भी फोर है

play11:43

और भी अच्छे तरीके बैटरीज में वेरिएबल

play11:45

डिफाइन करने के स्मार्ट लगता है की देखो

play11:48

मैं कितना इंटेलिजेंट हूं बट कोडिंग के

play11:50

अंदर रीडेबिलिटी सबसे जरूरी चीज है और उसी

play11:52

पे सबसे ज्यादा फोकस करना चाहिए इस तरह के

play11:55

ट्रिकी बिहेवियर ज्यादातर बड़ी कंपनियों

play11:56

में नहीं चलते हैं वहां पे क्योंकि आपके

play11:58

बाद भी 10 लोग आएंगे जिनको कोड पढ़ना है

play12:00

वहां पे ज्यादा बटोर रहेगा अच्छा इसके

play12:03

अलावा एक छोटा सा ऑपरेशन और होता है जो

play12:04

आपको कई बार दिखाई देगा जैसे की फॉर

play12:07

एग्जांपल गेम काउंटर वैसी बात है गेम

play12:10

काउंटर को तो इंक्रीज ही होना है तो

play12:12

सपोर्ट करिए आप ने स्टार्ट किया था 100

play12:13

पॉइंट्स के साथ तो उसके बाद अब क्या है की

play12:16

आपने गेम काउंटर लिया और उसको प्लस प्लस

play12:18

कर दिया तो अब गेम काउंटर की वैल्यू क्या

play12:20

होगी तो यहां पे जो आप देखेंगे कई बार

play12:22

ट्रिकी क्वेश्चंस भी होते हैं सबसे पहले

play12:25

हम गेम काउंटर की वैल्यू यहां पे प्रिंट

play12:27

करते हैं

play12:28

है ताकि एटलिस्ट हमें पता रहे और इन दोनों

play12:31

लाइंस कम कमेंट कर देते हैं

play12:34

इन्वेस्टिगेशन स्टडी चल रही है इसीलिए तो

play12:36

गेम काउंटर की वैल्यू हम यहां पर देखते

play12:38

हैं तो

play12:40

गेम काउंटर टाइपिंग मिस्टेक होती रहती है

play12:45

ठीक है

play12:51

अच्छा कई बार आपको क्या दिखेगा की इस तरह

play12:53

से नहीं इसकी वैल्यूज

play12:56

कुछ इस तरह

play13:00

की वैल्यू वापस से वैन वैन आई तो यहां पर

play13:04

कुछ बार कुछ टाइम पर क्या होगा की आप से

play13:06

पूछा जाएगा प्रेसिडेंट ऑपरेटर प्रीफिक्स

play13:09

अगर करते हैं तो क्या होता है पोस्ट फिक्स

play13:10

करते तो क्या करते हैं इस एग्जांपल के

play13:13

अंदर तो हमें कोई भी चीज नहीं दिखाया बट

play13:15

एक्चुअली

play13:20

कहां से चाहिए की वैल्यू

play13:23

इंक्रीमेंट हो जाती है

play13:27

लेकिन यह

play13:34

मन यहां पर आपको देखना है तो यहां पर

play13:38

इंक्रीमेंट जो है ऑपरेटर्स के बारे में

play13:39

पूरा अच्छे से डिटेल डिस्क्रिप्शन है की

play13:42

प्रीफिक्स हो तो क्या हो पोस्टफिक्स हो तो

play13:44

क्या हो अब आपको क्या करना है कुछ नहीं

play13:46

होगी यहां पे आपको क्या करना है ये जो

play13:50

इंक्रीमेंट ऑपरेटर है यहां पर दोनों के

play13:51

एग्जांपल दे रखे हैं प्लस प्लस ए और एक्स

play13:54

+ सिंपली जाइए इनको थोड़ा स्टडी करने की

play13:57

कोशिश करिए ज्यादा बड़ा सिंटेक्स नहीं आप

play13:59

आसानी से इसको समझ सकते हैं थोड़ा सा आप

play14:01

सिंटेक्स यहां पर इसको जाइए थोड़ा सा रीड

play14:03

करिए क्योंकि देखिए कब तक ही आप मुझसे यह

play14:06

ट्यूटोरियल से सीखते रहेंगे कभी ना कभी तो

play14:07

डॉक्यूमेंटेशन में जाना है छोटा सा टॉपिक

play14:09

है नहीं समझ में आएगा तो मैं हूं वीडियो

play14:11

बना दूंगा लेकिन थोड़ा सा कोशिश करिए

play14:13

प्रीफिक्स पोस्टफिक्स में जाइए छोटा सा

play14:16

साइनमेंट है जाके उसको सॉल्व करिए अच्छा

play14:18

इतना ही है इसके अलावा आप कुछ पढ़ना चाहें

play14:20

तो मैं आपको इसका लिंक भी दे देता हूं

play14:22

ताकि आप ये जो कन्वर्जन वाला टॉपिक है ये

play14:25

आप यहां से पढ़ पाएं ठीक है लिंक तू स्टडी

play14:31

तो यह आपके पास लिंक है मैं इसको यहां पर

play14:33

कमेंट कर देता हूं तो अब आपके पास छोटा सा

play14:36

कम है की इसको थोड़ा सा पड़ी है कोशिश

play14:38

करिए समझ में आता है नहीं आता नहीं आता

play14:40

कोई बात नहीं और सबसे इंपॉर्टेंट एमडीएम

play14:42

पर जाकर प्रीफिक्सर पोस्ट के बारे में

play14:43

पढ़िए अब इतना ही है हमारे पास कन्वर्जन

play14:46

और ऑपरेशंस के बारे में इससे ज्यादा डिटेल

play14:48

आपको जानने की जरूरत नहीं है जो भी आपको

play14:50

जानना होगा जैसे-जैसे हम प्रोजेक्ट

play14:52

बनाएंगे वहां पे आपके और कॉन्सेप्ट क्लियर

play14:54

हो जाएंगे ठीक है तो शेयर करिए वीडियो को

play14:56

सब्सक्राइब करना ना भूलिए मिलते हैं अगले

play14:59

वीडियो में

Rate This

5.0 / 5 (0 votes)

相关标签
JavaScriptCodingConversionsOperationsProgrammingWeb DevelopmentDeveloper TipsCode ExamplesSyntaxEducational
您是否需要英文摘要?