Great job on starting a new lesson! In the FAQ, test yourself by clicking the correct answer for each question. Then, click Next button at bottom right to continue.
JavaScript Data Types
JavaScript has seven data types, which represent different kinds of values. JavaScript variables can store values of these data types.
What are the 7 data types in JavaScript?
These data types include strings, numbers, booleans, arrays, objects, null, and undefined. Each data type serves a specific purpose and has its own characteristics.
JavaScript Example: Data Types
// JavaScript data types examples var name = 'Jack'; // string data type var age = 32; // number data type var isStudent = true; // boolean data type var numbers = [1, 2, 10, 3]; // array data type var person = { name: 'John', age: 25 }; // object data type var emptyValue = null; // null data type var undefinedValue = undefined; // undefined data type document.write(name + ' '); document.write(age + ' '); document.write(isStudent + ' '); document.write(numbers + ' '); document.write(person + ' '); document.write(emptyValue + ' '); document.write(undefinedValue + ' ');
FAQ (Interview Questions and Answers)
-
How many data types are there in JavaScript?
Seven
Five
Ten
-
What is the data type used to represent a group of values in JavaScript?
String
Number
Array
-
Which data type represents the absence of a value in JavaScript?
number
boolean
null
-
What data type is assigned to a variable that has been declared but not assigned a value?
string
number
undefined
-
Can a JavaScript variable store multiple data types?
No, a variable can only hold one data type.
Yes, a variable can hold different data types.
Yes, but only if it's declared as an object.
Your Total Score: 0 out of 5
Remember to just comment if you have any doubts or queries.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.