Skip to main content

Fundamentals of Front End Development MCQs with Answers

Practice important Fundamentals of Front End Development MCQs with answers and explanations.

Chapter: 78
Q881:
What is the result of +"John"?
A. NaN
B. "John"
D. "NaN"
Correct Answer: A
Chapter: 78
Q882:
What will 5 + null return?
A. 5
B. null
C. "5null"
Correct Answer: A
Chapter: 78
Q883:
Fill in the blank: The global method _____ converts an empty string to 0.
A. Number()
B. String()
C. parseInt()
D. toFixed()
Correct Answer: A
Chapter: 78
Q884:
What method is used to convert a date to a string?
A. String()
B. Date().toString()
C. toString()
D. toDateString()
Correct Answer: B
Chapter: 78
Q885:
What is the result of +"5"?
A. 5
B. "5"
C. NaN
D. "number"
Correct Answer: A
Chapter: 79
Q886:
What does the i modifier do in a regular expression?
A. Perform a global match
B. Perform case-insensitive matching
C. Perform multiline matching
D. Find a digit
Correct Answer: B
Chapter: 79
Q887:
Which method returns true or false depending on whether a pattern is found?
A. exec()
B. search()
C. replace()
D. test()
Correct Answer: D
Chapter: 79
Q888:
What will /e/.test("The best things in life are free!") return?
A. e
B. 1
D. null
Correct Answer: B
Chapter: 79
Q889:
Fill in the blank: The metacharacter _____ finds a digit.
A. \s
B. \b
C. \d
D. \u
Correct Answer: C
Chapter: 79
Q890:
What does the g modifier do in a regular expression?
A. Perform case-insensitive matching
B. Perform a global match
C. Perform multiline matching
D. Find a whitespace character
Correct Answer: B
Chapter: 79
Q891:
Which method searches a string for a pattern and returns the found text?
A. exec()
B. search()
C. replace()
D. test()
Correct Answer: A
Chapter: 79
Q892:
What does [0-9] in a regular expression match?
A. Any digit
B. Any alphabetic character
C. Any whitespace character
D. Any special character
Correct Answer: A
Chapter: 79
Q893:
Fill in the blank: The quantifier _____ matches any string that contains zero or more occurrences of a character.
A. n*
B. n+
C. n?
D. n{n}
Correct Answer: A
Chapter: 79
Q894:
What is the result of /x/.exec("example")?
A. x
B. example
C. null
D. e
Correct Answer: A
Chapter: 79
Q895:
Fill in the blank: The metacharacter _____ finds a whitespace character.
A. \d
B. \s
C. \b
D. \u
Correct Answer: B
Chapter: 79
Q896:
Fill in the blank: The quantifier _____ matches any string that contains zero or one occurrence of a character.
A. n*
B. n+
C. n?
D. n{n}
Correct Answer: C
Chapter: 79
Q897:
What does the regular expression /\bword\b/ match?
A. The word "word" as a whole word
B. The word "word" anywhere
C. Any word containing "word"
D. The letter "w" followed by "ord"
Correct Answer: A
Chapter: 80
Q898:
What does hoisting refer to in JavaScript?
A. Moving variables to the top of the script
B. Moving function definitions to the bottom
C. Moving initializations to the top
D. Moving comments to the top
Correct Answer: A
Chapter: 80
Q899:
Fill in the blank: In JavaScript, declarations are _____ but initializations are not.
A. hoisted
B. ignored
C. executed
D. converted
Correct Answer: A
Chapter: 80
Q900:
What will be the output of the following code?
A. 5
B. undefined
C. null
D. Error
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Fundamentals of Front End Development

🚀 Start Quiz Now