JavaScript Beginner Test
Time Elapsed: 0 seconds
1. What is the output of the following code?
console
.
log
(
5
+
3
*
2
);
a) 16
b) 13
c) 11
d) 10
2. Which keyword is used to declare a constant in JavaScript?
a) let
b) const
c) var
d) static
3. How do you declare a function in JavaScript?
a) function myFunction() {}
b) def myFunction() {}
c) void myFunction() {}
d) func myFunction() {}
4. What is the output of the following code?
let
x
=
5
;
let
y
=
10
;
console
.
log
(
x
==
y
);
a) true
b) false
c) x
d) y
5. How do you create an array in JavaScript with the elements 1, 2, and 3?
6. Explain the difference between
let
and
var
in JavaScript.
7. Write a JavaScript expression to check if the string "hello" contains the substring "ell".
8. What is the purpose of the
async
and
await
keywords in JavaScript?
Trending Tags
business
jobs
C or C++
C#
javascript
problems
python
rust
startups
writing