Java script: 17 flashcards
All 17 flashcards from this kit, free and with no sign-up.
1. JavaScript માં variable declare કરવા માટે કયા ત્રણ keywords વપરાય છે?
Show the answer
`var`, `let`, અને `const`
2. `let` અને `var` વચ્ચેનો મુખ્ય તફાવત શું છે?
Show the answer
`let` block-scoped છે, જ્યારે `var` function-scoped છે. `var` hoisting દરમિયાન `undefined` થાય છે, પણ `let` Temporal Dead Zone (TDZ) માં રહે છે.
3. `const` variable ને ફરીથી assign કરી શકાય?
Show the answer
ના, `const` variable ને reassign કરી શકાતું નથી. પણ જો તે object અથવા array હોય, તો તેના properties/items બદલી શકાય છે.
4. JavaScript માં primitive data types કયા છે?
Show the answer
`string`, `number`, `boolean`, `null`, `undefined`, `symbol`, અને `bigint`
5. `typeof null` નું output શું આવે છે અને શા માટે?
Show the answer
`"object"` આવે છે. આ JavaScript ની જૂની bug છે જે null ને object તરીકે ઓળખાવે છે.
6. `==` અને `===` વચ્ચે શું તફાવત છે?
Show the answer
`==` type coercion કરીને બે values ને સરખાવે છે, જ્યારે `===` type અને value બંને સરખાવે છે (strict equality).
7. JavaScript function declare કરવાની બે રીતો કઈ છે?
Show the answer
Function Declaration: `function name() {}` અને Function Expression: `const name = function() {}`
8. Arrow function નો syntax શું છે અને તે regular function થી કેવી રીતે અલગ છે?
Show the answer
Syntax: `const func = (params) => expression;`. Arrow functions પોતાનું `this` બાંધતા નથી; તે surrounding context પરથી `this` લે છે.
9. JavaScript માં `undefined` અને `null` વચ્ચે શું તફાવત છે?
Show the answer
`undefined` એ variable declare થયો પણ assign ન થયો હોય ત્યારે આવે છે. `null` એ intentional absence of any object value છે.
10. `typeof` operator શું કરે છે?
Show the answer
તે operand ના data type ને string તરીકે return કરે છે. ઉદા: `typeof 42` → `"number"`
11. JavaScript function માં parameters અને arguments વચ્ચે શું તફાવત છે?
Show the answer
Parameters function definition માં variables છે, જ્યારે arguments function call વખતે pass કરાયેલા actual values છે.
12. `function add(a, b) { return a + b; }` — આ function નું output શું આવશે જો `add(5)` call કરવામાં આવે?
Show the answer
`NaN` (Not a Number) આવશે, કારણ કે `b` undefined છે અને `5 + undefined` = `NaN`.
13. JavaScript માં hoisting શું છે?
Show the answer
Hoisting એ એવી વર્તણૂક છે જેમાં variable અને function declarations તેમના scope ની ટોચ પર 'lifted' થાય છે. `var` declarations hoisted થાય છે પણ `let` અને `const` TDZ માં રહે છે.
14. `let x = 10; x = "hello";` — આ code માં શું થશે?
Show the answer
તે valid છે. JavaScript dynamically typed છે, એટલે variable નો type બદલી શકાય છે.
15. Template literals શું છે અને તેનો syntax કેવો છે?
Show the answer
Template literals backticks (``) નો ઉપયોગ કરે છે અને `${expression}` દ્વારા variables/expressions embed કરી શકાય છે. ઉદા: `` `Hello ${name}` ``
16. JavaScript માં `NaN` શું છે અને તેને કેવી રીતે check કરવું?
Show the answer
`NaN` એ Not a Number છે, પણ તેનો type `number` છે. તેને check કરવા `isNaN()` અથવા `Number.isNaN()` વપરાય છે.
17. Function માં default parameters કેવી રીતે set કરવા?
Show the answer
Function definition માં parameter ને value assign કરીને: `function greet(name = "Guest") { ... }`
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Exam prep
Get Veda free See what students get
Free to start · No ads · Works in 42 languages