JAVASCRIPT QUICK GUIDE: A Step-by-Step Guide to JavaScript for Beginners by JACKSON KEVIN

JAVASCRIPT QUICK GUIDE: A Step-by-Step Guide to JavaScript for Beginners by JACKSON KEVIN

Author:JACKSON, KEVIN
Language: eng
Format: epub
Publisher: UNKNOWN
Published: 2023-12-05T00:00:00+00:00


Quiz:

​1. ​What is the purpose of a variable in JavaScript?

​● ​A. To perform mathematical operations

​● ​B. To store and manage data

​● ​C. To create loops

​● ​D. To define HTML elements

​2. ​Which keyword is used for declaring a constant variable in JavaScript?

​● ​A. let

​● ​B. const

​● ​C. var

​● ​D. constant

​3. ​What does the === operator do in JavaScript?

​● ​A. Compares values for equality without type conversion

​● ​B. Performs assignment

​● ​C. Compares values for equality with type conversion

​● ​D. Checks if a variable is undefined

​4. ​Which of the following is a correct way to declare an array in JavaScript?

​● ​A. let fruits = { "apple", "banana", "orange" };

​● ​B. let fruits = ["apple", "banana", "orange"];

​● ​C. let fruits = "apple", "banana", "orange";

​● ​D. array fruits = ["apple", "banana", "orange"];

​5. ​What does the for loop in JavaScript primarily do?

​● ​A. Repeats a block of code while a condition is true

​● ​B. Executes a block of code a specific number of times

​● ​C. Executes code when a specific event occurs

​● ​D. Iterates over the properties of an object

​6. ​Which JavaScript operator is used for combining multiple conditions in an if statement?

​● ​A. || (logical OR)

​● ​B. && (logical AND)

​● ​C. ! (logical NOT)

​● ​D. == (equality)

​7. ​What is the purpose of a JavaScript function?

​● ​A. To declare variables

​● ​B. To perform mathematical operations

​● ​C. To store data in arrays

​● ​D. To encapsulate and reuse a block of code

​8. ​How do you access an element in an array by its index in JavaScript?

​● ​A. array.getElement(2);

​● ​B. array.item(2);

​● ​C. array[2];

​● ​D. array.access(2);

​9. ​Which JavaScript data type is used for true/false values?

​● ​A. String

​● ​B. Number

​● ​C. Boolean

​● ​D. Array

​10. ​What is the purpose of comments in JavaScript?

​● ​A. To execute code

​● ​B. To define variables

​● ​C. To provide explanations and make code more readable

​● ​D. To create loops

Answers:

​1. ​B

​2. ​B

​3. ​A

​4. ​B

​5. ​B

​6. ​B

​7. ​D

​8. ​C

​9. ​C

​10. ​C



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.