Q: Which of the following selections serves as the literal hexadecimal start?
-
A
00
-
B
0x
-
C
0X
-
D
Both 0x and 0X
D
Answer:
D
Explanation:
In JavaScript, you can use the prefix 0x or 0X to denote a hexadecimal number.
For example:
let x = 0xFF; // x is 255
let y = 0XFF; // y is also 255
In this example, the variables x and y are both assigned the hexadecimal value FF, which is equivalent to the decimal value 255.
Related Topic:
Share Above MCQ