Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce JS-Dev-101 Exam - Topic 1 Question 2 Discussion

Refer to the code:const pi = 3.1415926;What is the data type of pi?
D) Number
A) Float
B) Double
C) Decimal

Salesforce JS-Dev-101 Exam - Topic 1 Question 2 Discussion

Actual exam question for Salesforce's JS-Dev-101 exam
Question #: 2
Topic #: 1
[All JS-Dev-101 Questions]

Refer to the code:

const pi = 3.1415926;

What is the data type of pi?

Show Suggested Answer Hide Answer
Suggested Answer: D

________________________________________

Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge

JavaScript has one numeric data type for all real numbers, whether integers or decimals.

This type is simply called:

Number

It follows the IEEE 754 double-precision floating-point standard internally,

but JavaScript does not expose separate types like float, double, or decimal.

Therefore:

It is not Float JavaScript does not have float primitives.

It is not Double this refers to the underlying IEEE 754 representation, but JavaScript's type is still just ''Number.''

It is not Decimal JavaScript has no built-in decimal type.

The correct answer is Number.

________________________________________

JavaScript Knowledge Reference (text-only)

JavaScript has a single numeric type: Number.

All numbers---integers, fractions, floating point---use the Number type.

==================================================


Contribute your Thoughts:

0/2000 characters
Chan
24 days ago
I thought it was a Double!
upvoted 0 times
...
Devora
29 days ago
Definitely a Float, right?
upvoted 0 times
...
Oneida
1 month ago
It's a Number type in JavaScript!
upvoted 0 times
...
Lynna
1 month ago
I agree, it's just a Number!
upvoted 0 times
...
Anika
1 month ago
Wait, is it really just a Number? That seems too simple.
upvoted 0 times
...
Jess
2 months ago
I thought it would be Double, but I guess not!
upvoted 0 times
...
Karina
2 months ago
Definitely a Float, right?
upvoted 0 times
...
Berry
2 months ago
It's a Number type in JavaScript!
upvoted 0 times
...
Alex
2 months ago
I thought Decimal was used for financial calculations, so it can't be pi. I’m leaning towards Double, but I need to double-check.
upvoted 0 times
...
Sean
2 months ago
I’m confused between Float and Double. I feel like I saw something about precision differences in a practice question.
upvoted 0 times
...
Aileen
3 months ago
I remember practicing a question about data types, and I think "Number" might be the right answer since JavaScript uses it for all numeric values.
upvoted 0 times
...
Oliva
3 months ago
I think pi is a float because it has decimal points, but I'm not entirely sure.
upvoted 0 times
...

Save Cancel