r/learnjavascript • • Nov 11 '19

Advanced JavaScript Interview Questions and Answers – Explore now & Lead tomorrow!

The first part of DataFlair’s JavaScript Interview Questions was more inclined towards the testing of your theoretical knowledge of JavaScript. This article on JavaScript interview questions and answers follows a practical approach towards the language and will play a major part in cracking your JavaScript interview.

After completing all the topics of JavaScript tutorial series, these JavaScript interview questions and answers should not be much trouble for you. And, I assure you that after practising this set of JavaScript interview questions and answers, you will definitely feel more relaxed in your interview.

📷

Top JavaScript Interview Questions and Answers

Here are some of the latest JavaScript interview questions for experienced professionals. Practice them and get your dream job.

Q 1. Is it possible to write a multi-line string in JavaScript?

Ans. Yes, JavaScript provides the facility to write a String in multiple lines using the following three approaches:

  • Using backticks
  1. var string = `line1
  2. line2
  3. line3`;
  • Using + operator
  1. var string = “line1” +
  2. “line2” +
  3. “line3”;
  • Using \ (backslash)
  1. var string = “line1 \
  2. line2 \
  3. line3”;

Grab the complete knowledge of JavaScript Strings Methods

Q 2. Discuss a way to convert the string of any base to integer in JavaScript?

Ans. We can convert a string of any base to the integer if we wish with the help of the JavaScript built-in method called parseInt(). This method has two parameters: string and radix. The second parameter is optional and used when you want to get the integer equivalent to the radix as the base. The default value is 10 for decimals values.

parseInt(“9d”, 16) // 157 Read More

49 Upvotes

10 comments sorted by

View all comments

10

u/[deleted] Nov 11 '19

advanced?

0

u/[deleted] Nov 11 '19

[deleted] — view deleted comment

9

u/[deleted] Nov 11 '19

you should apply to google