TutorialPedia.org
Toggle Menu
Home
Online Go Compiler
Tutorials
JavaScript Tutorials
Golang Tutorials
Linux Command Line Tutorials
Blog
All Posts
JavaScript Fundamentals
Check your understanding of JavaScript basics like variables,functions,and scope.
1. Which keyword declares a block-scoped variable that can be reassigned in JavaScript?
var
let
const
function
2. Which of the following are considered truthy values in JavaScript (select all that apply)?
0
"false"
null
[]
undefined
3. JavaScript is a statically typed language.
True
False
4. What does 'ES' stand for in ES6 (ECMAScript 6)?
5. Which of the following is NOT a primitive data type in JavaScript?
String
Number
Object
Boolean
6. Which array methods mutate the original array (select all that apply)?
push()
map()
sort()
filter()
splice()
7. The 'this' keyword in a global function (non-strict mode) refers to the window object in browsers.
True
False
8. What operator checks both value and type equality without coercion?
9. Which of the following is fully hoisted in JavaScript?
Function declarations
Function expressions
Variables declared with let
Variables declared with const
10. Which array methods return a new array without mutating the original (select all that apply)?
forEach()
map()
filter()
slice()
push()
11. typeof null returns 'null' in JavaScript.
True
False
12. What is the result of: 3 + '3'?
13. Which data type is returned by the typeof operator for an array?
array
object
list
collection
14. Which are primitive data types in JavaScript (select all that apply)?
Symbol
Array
BigInt
Undefined
Object
15. Variables declared with var are block-scoped.
True
False
16. What method adds elements to the end of an array and returns the new length?
17. What is the value of an undeclared variable in JavaScript?
null
undefined
0
Throws a ReferenceError
18. Which are valid loop structures in JavaScript (select all that apply)?
for
while
do-while
for-each
repeat-until
19. In JavaScript, objects are passed by reference.
True
False
20. What keyword exits a function and returns a value?
Reset
Answered 0 of 0 — 0 correct