Skip to content

Commit 59b452d

Browse files
modified
1 parent 2c1e740 commit 59b452d

32 files changed

+426
-431
lines changed

Interview Questions/interview-questions-english.md

+388-343
Large diffs are not rendered by default.

notes/Hindi/03-separation-of-concerns.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ JavaScript ko HTML mein link karne ke liye aapko <script> tag ka upyog karna hot
2424

2525
3. Ab HTML page ko open karein aur head section mein <script> tag ka upyog karein. Iske baad src attribute mein apne JavaScript file ka path dena hoga. Yeh path relative ho sakta hai ya absolute bhi ho sakta hai.
2626

27-
4. Yeh ek example hai jo aapko help karega. Yahan par maine ek JavaScript file "script.js" banaya hai aur use "index.html" mein link kiya hai.
27+
4.Yahan par maine ek JavaScript file "script.js" banaya hai aur use "index.html" mein link kiya hai.
2828

2929
```javascript
3030
<!DOCTYPE html>
@@ -40,5 +40,3 @@ JavaScript ko HTML mein link karne ke liye aapko <script> tag ka upyog karna hot
4040
```
4141

4242
Is example mein, humne <script> tag ka upyog kiya aur usmein src attribute mein "script.js" ka path diya hai. Agar script.js file index.html file se alag folder mein hai toh aapko path ko accordingly update karna hoga.
43-
44-
Mujhe ummeed hai ki yeh example aapko help karega JavaScript file ko HTML page se link karne mein.

notes/Hindi/10-operators.md

-2
Original file line numberDiff line numberDiff line change
@@ -367,5 +367,3 @@ console.log(result); // Output: 20
367367
```
368368

369369
In this example, the expression `num2 * 2` is evaluated first (giving us 10), and then added to num1, giving a result of 20.
370-
371-
I hope this helps you understand operator precedence in JavaScript!

notes/Hindi/17-loopand_switch.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ for (let i = 0; i < fruits.length; i++) {
7272

7373
Yahan `fruits` ek array hai jismein hum 3 strings store kar rahe hain. For loop ke ander counter variable `i` hai jo 0 se shuruat karta hai aur `fruits.length` (yani 3) tak chalta hai. Har iteration ke baad hum `console.log(fruits[i])` ka use karke current index ki value console par print karte hain.
7474

75-
Iska output niche diya gaya hai:
76-
7775
```
7876
Apple
7977
Banana
@@ -182,8 +180,6 @@ Iska output hoga:
182180
5
183181
```
184182

185-
Ummid hai ki ab aapko while loop ke baare mein achi tarah se samajh aa gaya hoga!
186-
187183
### What is do...while loop
188184

189185
Do...while loop ek aisa loop hai jo kisi bhi code block ko baar-baar execute karta hai jab tak ki uske condition ka result true na ho. Yeh loop pehle code block ko execute karta hai aur phir condition check karta hai. Agar condition true hoti hai to loop continue rahta hai, lekin agar condition false hoti hai tab bhi code block ko kam se kam ek baar execute kar diya jaata hai.
@@ -264,7 +260,7 @@ switch (expression) {
264260

265261
यहाँ expression value को evaluate करने के लिए है जो case के values से match करती हैं। अगर expression किसी bhi case value से match करता है, तो उस case का code block execute होता है। इसके बाद break statement से execution control switch block से बाहर निकल जाता है।
266262

267-
यहाँ एक उदाहरण है:
263+
example
268264

269265
```
270266
let day = "Monday";
@@ -324,8 +320,6 @@ Lekin humne break ka use kiya hai jab `i` ki value 3 ho jaati hai, isliye output
324320
3
325321
```
326322

327-
Iss tarah, break ka use karke hum loop ya switch statement ko jald se jald exit kar sakte hai.
328-
329323
### What is default case in a Switch Statement ?
330324

331325
Switch Statements are used in programming languages to execute different blocks of code based on the value of an expression.

notes/Hindi/18-string.md

-4
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ String literal = "Hello World!";
8383
String object = new String("Hello World!");
8484
```
8585

86-
Ummid hai yeh samjhane mein madad milegi.
87-
8886
### String length property
8987

9088
"String length property" refers to the number of characters in a string. It is a built-in property of the String object in JavaScript and can be accessed using the ".length" syntax.
@@ -206,5 +204,3 @@ console.log(str.toLowerCase()); // आउटपुट: hello world
206204
उदाहरण:
207205
var str = "Hello World";
208206
console.log(str.indexOf("o")); // आउटपुट: 4
209-
210-
5. slice(): यह फंक

notes/Hindi/19-scoping_and_scope.md

-2
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,3 @@ firstfunction();
3535
document.getElementById("value2").innerHTML = typeof Name;
3636
3737
```
38-
39-
Block Scope:

notes/Hindi/22-destructuring.md

+20-8
Original file line numberDiff line numberDiff line change
@@ -595,22 +595,26 @@ likhne ki jrurat ni hai.
595595
596596
- Old way
597597
598+
```
599+
598600
let obj = {
599-
sum: function (a, b) {
600-
console.log(a + b);
601-
},
601+
sum: function (a, b) {
602+
console.log(a + b);
603+
},
602604
};
605+
603606
```
604607
605608
- New way
606609
- Upar vale function ko niche vale function ki trah b likh skte hain
607610
608611
```
609-
obj = {
610-
sum(a, b) {
611-
console.log(a + b);
612-
},
613-
};
612+
613+
obj = {
614+
sum(a, b) {
615+
console.log(a + b);
616+
},
617+
};
614618

615619
```
616620
@@ -621,6 +625,7 @@ Generally object me keys ka name fix hota hai but agar humari aisi requirement h
621625
- for example :
622626
623627
```
628+
624629
let a = "age";
625630
obj = {
626631
[a + 2]: "learnjavascript",
@@ -637,6 +642,7 @@ Yadi object ke andar nested object hai aur hm us nested object se koi value extr
637642
- for example :
638643
639644
```
645+
640646
let obj = {
641647
address: {
642648
otherAddress: {
@@ -664,6 +670,7 @@ console.log(obj?.address?.otherAddress?.pincode); ///undefined
664670
- Checking array is empty
665671
666672
```
673+
667674
let arr = [1, 2, 4, 5];
668675
console.log(arr[2]?.address?.pincode); //undefined
669676

@@ -679,6 +686,7 @@ Yadi functiion bna hua ni hai aur hum use call kr rhe hain to error aayegi. But
679686
- for example :
680687
681688
```
689+
682690
let obj = {};
683691
obj?.printHello?.(); //No error
684692

@@ -690,6 +698,7 @@ obj?.printHello(); //Error
690698
- Using optional Chaining in conditon :
691699
692700
```
701+
693702
let obj = {
694703
name: "Sajid",
695704
age: 21,
@@ -724,10 +733,13 @@ console.log("City Not present");
724733
- With optional chaining
725734
726735
```
736+
727737
if (obj?.myAddress?.other?.city) {
728738
console.log("Hello");
729739
} else {
730740
console.log("City Not present");
731741
}
732742

733743
```
744+
745+
```

notes/Hindi/26-date.md

-2
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,3 @@ var intervalId = setInterval(function() {
222222
```
223223

224224
Yahan pe, setInterval function `function()` ko 1 second (1000 milliseconds) ke baad run karega. Jaise hi wo chalega, yeh `count` variable ko 1 increase karega aur usko console pe print karega. Agar `count` 5 ke equal ho jata hai, to setInterval ko clearInterval se cancel kar diya jayega.
225-
226-
Mujhe ummeed hai ki yeh samajhne mein madad karega!

notes/Hindi/27-DRY-principle.md

-2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ Now, whenever we need to calculate the area of a rectangle, we can simply call t
1919
const area = calculateRectangleArea(10, 20);
2020
console.log(area); // Output: 200
2121
```
22-
23-
This way, we have achieved code reusability and avoided duplicating code.

notes/Hindi/32-Destructuring-Array.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Destructuring of nested objects can be a powerful tool for working with complex
368368

369369
Destructuring का उपयोग javascript में विभिन्न तरीकों से किया जाता है, इसमें हम एक फंक्शन के पैरामीटर में डिफॉल्ट वैल्यूज और विभिन्न प्रकार की डेटा संरचनाओं (data structures) को बहुत सरल तरीके से अनपैक (unpack) करते हैं।
370370

371-
आइए एक उदाहरण के माध्यम से समझें:
371+
example
372372

373373
```
374374
function printUserDetails({name, age, location}) {

notes/Hindi/37-Optional-chaining.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Optional chaining ek aisi JavaScript ki suvidha hai jisse aap ek object ke upar
113113
114114
Ek array khali hai ya nahi check karne ke liye, aap optional chaining ka upayog karke uski length property ka istemaal kar sakte hain. `?.` operater ka use karke aap dekh sakte hain ki array hai ya nahi.
115115
116-
Yahan ek udahran diya gaya hai:
116+
example
117117
118118
```javascript
119119
const arr = [];

notes/Hindi/38-DOM.md

-2
Original file line numberDiff line numberDiff line change
@@ -384,5 +384,3 @@ Ab ek example se samjhte hain:
384384
```
385385

386386
Is example mein humne createElement method se ek naya &lt;p&gt; element banaya hai. Uske baad humne createTextNode method se "Hello World!" text ka naya node banaya hai. Phir humne appendChild method se is text node ko newly created &lt;p&gt; element ke andar daal diya hai. Finally, humne appendChild method se is new &lt;p&gt; element ko exist karne wale div ("#example") ke andar add kar diya hai.
387-
388-
Is tarah se hum createElement, createTextNode aur appendChild ke madad se DOM Nodes create aur manipulate kar sakte hain.

notes/Hindi/40-RegExp.md

-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,3 @@ str = str.replace(regex, "Hi");
2727

2828
console.log(str); // "Hi, World!"
2929
```
30-
31-
In summary, regular expressions are powerful tools for working with text patterns in JavaScript, and can be used to perform complex string manipulations with ease.

notes/Hindi/41-JSON-XML.md

-2
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,3 @@ for (let i = 0; i < books.length; i++) {
105105
```
106106

107107
In this example, we use the `getElementsByTagName` method to get an array of all the `book` elements in the XML document. We then loop over each `book` element and extract its `title`, `author`, `year`, and `price` elements using the `getElementsByTagName` method again. Finally, we log the information about each book to the console.
108-
109-
Hope that helps!

notes/Hindi/42-JavaScript-Engine.md

-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ JavaScript Engine ek computer program hota hai jo JavaScript code ko samajhne au
55
JavaScript engine ka kaam hota hai ki jab browser me koi webpage load hoti hai jisme JavaScript code likha gaya ho to vo engine us code ko padhta hai aur use machine language me convert karta hai jo ki computer samajh sakte hai. Is process ko "compilation" kehte hai.
66

77
Ek example ke roop me, Google Chrome ka V8 JavaScript engine bahut popular hai. Ye engine Node.js, Electron aur nw.js jaise tools ke saath bhi istemaal kiya ja sakta hai. Ye engine JavaScript code ko optimized tarike se compile karta hai, jisse ki code ki speed improve ho aur execution time kam ho.
8-
9-
Iss tarah se, JavaScript engine ek important component hai jo website aur web applications ko performant banane me madad karta hai.

notes/Hindi/43-Call-Stack.md

-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ Call Stack ek aisi jagah hai jahan JavaScript engine apne functions ko track kar
55
Ek example ke through samjhaate hain. Maan lijiye aapke paas do functions hain - `greet()` aur `hello()`. Ab aap `greet()` function ko call karte hain. Toh uss samay `greet()` function Call Stack me add ho jaata hai. Phir `greet()` function me se `hello()` function ko call karte hain. Tab `hello()` function bhi Call Stack me add ho jaata hai.
66

77
Ab `hello()` function execute hota hai aur call stack se hat jaata hai. Phir `greet()` function bhi execute ho jaata hai aur woh bhi call stack se hat jaata hai. Is tarah se Call Stack ka use karke JavaScript engine apna flow control maintain karta hai.
8-
9-
Ummid hai ki aapko samajh aa gaya hoga.

notes/Hindi/44-Execution-Context.md

-4
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ foo(); // Output: 15
4545

4646
जैसा कि ऊपर दिखाया गया है, `a` global variable है जो `foo()` function में reference किया जा सकता है। अब, `foo()` function का execution start होने पर उसका own variable environment create हुआ, जिसमें `b` variable की reference होती है। जब `console.log(a+b)` line execute हुई, तो जावास्क्रिप्ट engine ने `b` की value lookup करने के लिए `foo()` function के variable environment में देखा और इसके बाद `a` की value lookup करने के लिए global scope में देखा।
4747

48-
उम्मीद है यह समझने में मददगार साबित होगा।
49-
5048
### what is Type of execution context ? Global and Functional
5149

5250
JavaScript mein execution context ka matlab hota hai ki code kaise execute hoga. JavaScript 2 type ke execution context support karta hai:
@@ -79,5 +77,3 @@ function foo() {
7977
8078
foo(); // Output: 10
8179
```
82-
83-
Is tarah global aur functional execution context ka use karke JavaScript mein code execution ko manage kiya ja sakta hai.

notes/Hindi/46-Compiler-Interpreter-JIT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Jab aap apna JavaScript code banate hain, to Interpreter usko ek programming lan
3333

3434
Interpreter ek bahut hi important role nibhata hai JavaScript programming mein. Interpreter code ko debug karne mein bhi kaafi madad karta hai, kyonki wah error messages generate karta hai jab aapka code sahi nahi hota hai.
3535

36-
Yahan ek example diya gaya hai:
36+
example
3737

3838
```
3939
var x = 5;
@@ -60,4 +60,4 @@ Interpreter: Ye interpreter runtime par hota hai, matlab ki jab hamara code exec
6060

6161
Ek udaharan se samjhe to Compiler ka kaam ek teacher ke jaisa hota hai jo kisi student ke sare notes ko pehle se check karke unke mistakes ko sudhaar leta hai. Lekin Interpreter ka kaam ek translator ki tarah hota hai jo Foreign language me baat kar rahe vyakti ke vichaar ko dusre vyakti ko samjhane me madad karta hai.
6262

63-
Umeed hai ki ab aapko Compiler aur Interpreter ke beech ke antar ka sahi roop se samajh aa gaya hoga.
63+
.

notes/Hindi/49-Prototypal-Inheritance.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Inheritance और Classes दोनों JavaScript में Object-Oriented
6363

6464
Classes, जैसा कि नाम से पता चलता है, एक बनावट हैं जो एक नया Object बनाने के लिए उपयोग होती है। क्लास में आमतौर पर constructor फ़ंक्शन, method और properties होते हैं। निम्नलिखित उदाहरण में, हम क्लास बनाते हैं जिसका नाम Car होता है जिसमें मॉडल, रंग और स्पीड के लिए Properties और start, stop और drive के लिए methods होते हैं।
6565

66-
उदाहरण:
66+
example
6767

6868
```
6969
class Car {
@@ -93,7 +93,7 @@ myCar.drive(); // Driving the Red Tesla at 100 mph
9393

9494
Inheritance में, एक Class को दूसरी Class से inherit किया जाता है और उसकी Properties और methods को उस class के objects में उपलब्ध कराया जाता है। जब हम एक Class को inherit करते हैं, तो नई Class parent Class की सभी Properties और methods को इंहेरिट करती है और उन्हें override भी कर सकती है। निम्नलिखित उदाहरण में, हम Car class को extend करते हुए ElectricCar class बनाते हैं। ElectricCar class में नई Property battery को add किया गया है और drive method को override किया गया है।
9595

96-
उदाहरण:
96+
example
9797

9898
```
9999
class ElectricCar extends Car {
@@ -120,7 +120,7 @@ Constructor functions ka upyog hum new keyword ke saath object banane ke liye ka
120120

121121
A constructor function ka naam hamesha capital letter se shuru hota hai, jisse wo aasani se distinguish ho sake. Jab hum ise call karte hai to ye ek naya object bana deta hai aur usko return kar deta hai.
122122

123-
Yeh ek example hai:
123+
example
124124

125125
```javascript
126126
// Constructor function definition
@@ -144,5 +144,3 @@ Is example me humne `Car` naam ka ek constructor function define kiya hai. Ismei
144144
Phir humne `new` keyword ka use kiya hai jisse ki humne ek naya object `myCar` banaya hai. Is object ke andar `Car` constructor function ke property `make`, `model`, aur `year` ki values store ho gayi hai.
145145

146146
Last mein humne console par `myCar` ke alag alag properties ko access kiya hai.
147-
148-
Is tarah se hum constructor functions ka use karke apne code me objects create kar sakte hai aur unhe behtar tarike se manage kar sakte hai.

notes/Hindi/51-OOPs.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Yahan `Person` class mein `name` property ko access karne aur modify karne ke li
266266

267267
`person1` object ko create karne ke baad, humne `name` property ko `John` se `Jane` mein update kiya aur phir console par uski value ko print kiya.
268268

269-
Hinglish mein, Setters aur Getters JavaScript mein properties ko handle karne ke kaam aate hain. Setters property ki value ko set karte hain, jabki Getters property ki value ko retrieve karte hain. Upar diye gaye example mein, `Person` class mein `name` property ke liye `get` aur `set` functions ka use kiya gaya tha. `get` function `name` ki current value ko return karta hai, jabki `set` function `name` ki value ko set karta hai.
269+
Setters aur Getters JavaScript mein properties ko handle karne ke kaam aate hain. Setters property ki value ko set karte hain, jabki Getters property ki value ko retrieve karte hain. Upar diye gaye example mein, `Person` class mein `name` property ke liye `get` aur `set` functions ka use kiya gaya tha. `get` function `name` ki current value ko return karta hai, jabki `set` function `name` ki value ko set karta hai.
270270

271271
### what is Static methods
272272

@@ -618,5 +618,3 @@ console.log(result); // Output: 35
618618
```
619619

620620
In this example, we first call the `filter()` method on the `numbers` array to filter out all the even numbers, which returns a new array containing only the odd numbers. Then, we call the `map()` method on this filtered array to square each remaining number, which returns another new array with the squared numbers. Finally, we call the `reduce()` method on this mapped array to get their sum, which is stored in the `result` variable.
621-
622-
Overall, chaining methods in JavaScript can help simplify your code by allowing you to perform multiple operations on the same object in a single line.

notes/Hindi/52-Constructor function.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ console.log(myCar.make); // Output: Toyota
1919

2020
Is example mein, humne `Car` constructor function ko define kiya hai jismein `make`, `model`, aur `year` properties hain. Fir humne `new` keyword ka use karke ek naya Car object create kiya hai, jiska make `'Toyota'`, model `'Corolla'`, aur year `2020` hai.
2121

22-
Hinglish mein samjhane ke liye, hum keh sakte hai ki Constructor function ek template hai jisko hum use karke multiple objects create kar sakte hai. Ye ek blueprint ki tarah hota hai jismein hum properties and methods define karte hai jo har object ke liye same hote hai.
22+
hum keh sakte hai ki Constructor function ek template hai jisko hum use karke multiple objects create kar sakte hai. Ye ek blueprint ki tarah hota hai jismein hum properties and methods define karte hai jo har object ke liye same hote hai.
2323

2424
### what is new keyword
2525

2626
`new` एक JavaScript की keyword है जो object के instance को create करने के लिए use किया जाता है। जब हम `new` keyword का use करते हैं तो एक नया object create होता है जो class या constructor function से बना होता है।
2727

2828
इसके लिए, हमें एक constructor function बनानी होती है जो नया object create करती है। उसके बाद, हम `new` keyword का use करते हुए उस constructor function को call करते हैं। इस प्रकार, नया object create होता है और उसे variable में assign किया जाता है।
2929

30-
जैसे कि,
30+
example
3131

3232
```javascript
3333
// Constructor function
@@ -42,5 +42,3 @@ console.log(person1); // Output: {name: "John", age: 25}
4242
```
4343

4444
जैसा कि ऊपर दिखाया गया है, हमने `Person` constructor function create किया जो `name` और `age` property के साथ एक object create करता है। फिर हम `new` keyword का use करते हुए `Person` constructor function को call करते हैं और नया object `person1` create करते हैं।
45-
46-
इस प्रकार, हम `new` keyword का use करके JavaScript में objects को create कर सकते हैं।

notes/Hindi/53-Object-create.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Prototype parameter ke through aap specify kar sakte hai ki aapka naya object ki
66

77
PropertiesObject parameter optional hai aur ismein aap apne naye object ke property aur unki values set kar sakte hai.
88

9-
Chaliye ek example dekhte hai:
9+
example
1010

1111
```
1212
// Create a person object as prototype
@@ -28,5 +28,3 @@ john.greeting(); // Output: Hello, my name is John
2828
```
2929

3030
Is example mein humne ek `person` object create kiya jiska `greeting` method hai. Fir humne `Object.create()` function ka use karke ek naya object `john` create kiya jiske prototype ke roop mein `person` object set kiya gaya hai. Ab humne `john` object ke properties set kiye jaise ki `name` aur `age`, fir `greeting()` method ko call kiya jisne apna output `"Hello, my name is John"` diya.
31-
32-
Yehi tarika aap Object.create() ka use karke apne JavaScript applications mein implement kar sakte hai.

0 commit comments

Comments
 (0)