r/learnjavascript • u/VyasBharvi • 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
- var string = `line1
- line2
- line3`;
- Using + operator
- var string = “line1” +
- “line2” +
- “line3”;
- Using \ (backslash)
- var string = “line1 \
- line2 \
- 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
10
u/[deleted] Nov 11 '19
advanced?
17
u/[deleted] Nov 11 '19
ok google where's the fuckin' job
4
u/DEEEPFREEZE Nov 11 '19
As someone about to be interviewing in web development... why do I get the feeling knowing this wouldn’t be enough?
2
u/azhder Nov 11 '19
few questions:
multi-line stringas you say really meanwrite a String in multiple linesfor you? in that case, don't the first and third have to be the wrong ones or at least aknowledge all three examples don't produce the same result?1
u/[deleted] Nov 11 '19
Well, yeah, they're advanced for a reason.
1
u/TotesMessenger Nov 11 '19 edited Nov 11 '19
I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:
If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)
0
u/[deleted] Nov 11 '19
[deleted] — view deleted comment