Tricky JavaScript Interview Questions and Answers




Hard JavaScript Interview Questions and their possible answers ( cracking difficult coding interview questions )

Article and code samples from this tutorial
* techsith.com

Please be my patreons on patreaon
* https://www.patreon.com/techsith

Follow me for technology updates
* https://facebook.com/techsith
* https://twitter.com/techsith1

Help me translate this video.
* http://www.youtube.com/timedtext_video?ref=share&v=qsNxdukPc2U
Note: use https://translate.google.com/ to translate this video to your language. Let me know once you do that so i can give you credit. Thank you in advance.

Original source


28 responses to “Tricky JavaScript Interview Questions and Answers”

  1. The unique values in new array can be achieved by Set object and spread operator as following,
    const numbers = [1,2,2,3];
    let uniqueNumArr = [… new Set(numbers)];
    console.log("Unique Array : ", uniqueNumArr);

  2. as "+" behaves as concatenate operator in first console JavaScript automatically converts int 2 to string and concatenate to result into = 22. While in second console log "-" acts as subtraction operator and converts string to integer and results to = 0.

  3. his accent and voice suckss… even though his ideas are great… why do he even change and talk… yaaak.. cant even listen more than 5min…. rather i would stop going for an interview….

  4. I don't understand why there're so many haters… Those are actually good and valid tricky questions. Btw sir, you mentioned that you have another channel that teaches algorithm and data structures, where is the link?

  5. Hi Its great thanks for teaching too instead of only giving the answers, You are letting us think, Great thanks for the videos. And if you have video on spread operator do let me know I was asked this in one of my Interview I have an obj ={ name :" likitha",age : 30 } if you want to change the name property alone to be modified ,you can use spread operator { name: "lohitha" ,…obj} ->this is the answer anyways -> {name : "likitha"} ,but I had no idea of how spread can work in different ways how do they come up with this , I know the spread operator but I am not aware of this option ..,Please do let me know..

  6. Not sure I understand why it would compare to -Infinity. It seems like it should see the length of arguments and return the first one if there's just one. If there are more, it should start comparing them to each other. Not sure how -Infinity logic comes into play. If you pass nothing, I'd actually expect it to return Infinity, not the opposite. I'm not sure if the way it works is based off how you do things in math or just a base assumption made by JavaScript authors.

Leave a Reply