ExamVeda
Login
Home
21
What is the purpose of the radix parameter in the parseInt() method?
Discuss
Answer & Solution
Answer: Option B
Solution:
The radix parameter is used to specify which numeral system to be used, for example, a radix of 16 (hexadecimal) indicates that the number in the string should be parsed from a hexadecimal number to a decimal number.
22
What will be the radix value of the parseInt() method when the string begins with 0?
Discuss
Answer & Solution
Answer: Option C
Solution:
If the string begins with “0”, the radix is 8 (octal). This feature is deprecated.
23
What is the purpose of the method JSON.parse()?
Discuss
Answer & Solution
Answer: Option B
Solution:
The JSON.parse() method parses a string as JSON, optionally transforming the value produced by parsing.
24
What is the return type of the method parseInt()?
Discuss
Answer & Solution
Answer: Option C
Solution:
The method parseInt() returns an integer.
25
What are the parameters of the method JSON.parse()?
Discuss
Answer & Solution
Answer: Option C
Solution:
The parameters of the method JSON.parse() are :
1. text : The string to parse as JSON. 2. reviver : If a function, prescribes how the value originally produced by parsing is transformed, before being returned.
26
What will be the radix value of the parseInt() method when the string begins with any other value other than 0x and 0?
Discuss
Answer & Solution
Answer: Option C
Solution:
The radix value will be 10 when the string of the method parseInt() begins with any other value other than 0x and 0.
27
What kind of an exception will be thrown if the string to parse is not valid JSON?
Discuss
Answer & Solution
Answer: Option A
Solution:
The method JSON.parse()throws a SyntaxError exception if the string to parse is not valid JSON.
28
Which of the following is a JavaScript Compressor?
Discuss
Answer & Solution
Answer: Option B
Solution:
UgilifyJS is a parser, JavaScript Compressor and a beautiful toolkit.
29
What is the purpose of the UgilifyJS?
Discuss
Answer & Solution
Answer: Option C
Solution:
UglifyJS2 is an excellent tool to help you minify your JavaScript! It’s a tried and tested tool, used by libraries such as jQuery.
30
Which of the following is the fastest JavaScript parser?
Discuss
Answer & Solution
Answer: Option C
Solution:
Acron is the fastest JavaScript parser written in JavaScript which takes only 96.9ms when compared to all the JavaScript parsers available.