/  JavaScript-Datatypes-Quiz

This Quiz contains totally 10 Questions each carry 1 point for you.

1.JavaScript Code can be called by using
RMI
Triggering Event
Preprocessor
Function/Method

Correct!

Wrong!

2. The snippet that has to be used to check if “a” is not equal to “null” is
if(a!=null)
if (!a)
if(a!null)
if(a!==null)

Correct!

Wrong!

3. Predict the result.

var bar = 1;

fun = {};

fun: {

bar:2;

X: ++bar;

};

fun.x + fun.bar +bar;
undefined
4
5
NaN

Correct!

Wrong!

4. What data type would you use to store a discount rate (e.g. 10%)?
String
Boolean
Float
Integer

Correct!

Wrong!

5. What data type would you use for a variable called: isCorrect = True
String
Float
Integer
Boolean

Correct!

Wrong!

6. What data type for a constant called: PI = 3.14
String
Integer
Float
Date

Correct!

Wrong!

7. What will be the output of the following code?

<script>

document.write(typeof(24.49));

</script>
Float
Number
Integer
Double

Correct!

Wrong!

8. In JavaScript, we do not have datatypes like integer and float. What is the function that can be used to check if the number is an integer or not?
Integer(value)
ifInteger(value)
isInteger(value)
ifinteger(value)

Correct!

Wrong!

9. Predict the output on the console for the following JavaScript code.

<script>

let hello = 'helloworld';

console.log(typeof hello);

hello=1;

console.log(typeof hello);

</script>
string number
string string
null null
string integer

Correct!

Wrong!

10. What does the following expression return?

NaN === NaN;
True
False
NaN
None

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

Ignore & go to results

Javascript – DataTypes – Quiz

You got %%score%% of %%total%% right

%%description%%

%%description%%

Where to go ?

Quizzes

Loading...