Tricky JavaScript interview questions and answers

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 1.1K

  • @vinodhkumar457
    @vinodhkumar457 7 ปีที่แล้ว +82

    This one is important for JS developers.

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว +6

      Thanks for watching ! :) Thanks for the support ! )

    • @JLO72713
      @JLO72713 3 ปีที่แล้ว

      Very helpful, your you defeated the Google beast

  • @sadunozer2241
    @sadunozer2241 ปีที่แล้ว

    5 years later and this video is still relevant. I didn’t watch it fully this time… but I do remember everything about it vividly. An absolute classic❤

  • @GabrielVasile
    @GabrielVasile 5 ปีที่แล้ว +4

    For getting total number of arguments, in ES6 we can do
    let x = function (...args) {
    return args.length;
    }
    and for the method chaining we can use
    return this;

  • @zajebojca
    @zajebojca 7 ปีที่แล้ว +37

    This question with "returning total number of arguments" can be solved in much simpler way.
    const x = function(){
    return arguments.length;
    }
    The object 'arguments' has property ''length'.

    • @cassavandumbi2734
      @cassavandumbi2734 7 ปีที่แล้ว +1

      You are either wrong or you mean the opposite.
      the below returns 4
      function x(a,r,t){
      return arguments.length;
      }
      console.log(x(5,5,6,7))

    • @dand8282
      @dand8282 6 ปีที่แล้ว +2

      you can count formal parameters (aka "required arguments") with function.length, not arguments.length, which is a count of what's passed.

    • @kamoroso94
      @kamoroso94 6 ปีที่แล้ว +1

      I was thinking the same thing, but also what's the point of no loops? How would a loop even help solve this problem lol.

    • @ravikumargrandhi6315
      @ravikumargrandhi6315 6 ปีที่แล้ว

      output will be 4

    • @ravikumargrandhi6315
      @ravikumargrandhi6315 6 ปีที่แล้ว +1

      x(.....) function will return how many arguments you are passing while calling x(....).

  • @vinikett9114
    @vinikett9114 4 ปีที่แล้ว +4

    Brother you are one of the most efficient teachers for teaching programming on youtube that i could find.You explain concepts really well.Its sad that youtube is doing this to constructive youtubers like you.You have all my support!

  • @ArjunKesava
    @ArjunKesava 5 ปีที่แล้ว +4

    To print the length of arguments (17:33), we can simply write:
    return arguments.length;
    inside the function instead of using Slice method.

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว +1

      That is true Arjun. Slice helps to convert argument to an array and then you can use other array features like join() and things.

  • @robertmasters5578
    @robertmasters5578 6 ปีที่แล้ว +4

    This is great, I have a couple of job interviews next week for JavaScript roles and you have really helped me to build my confidence in preparation for this. Please keep posting videos :-)

  • @pmahesh6789
    @pmahesh6789 4 ปีที่แล้ว

    Your all videos so far I have been seen are really deserves thumbs up ( 👍 ), Please keep doing your good work... and hope TH-cam should not harm you.

  • @rojiherrera
    @rojiherrera 7 ปีที่แล้ว +21

    "This is an INTERVIEW, not a RACE" -techsith ☝️

  • @kamoroso94
    @kamoroso94 6 ปีที่แล้ว

    TH-cam's algorithm is so stupid. Your videos are good quality and don't deserve to be demonitized.

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว +1

      Thanks for the support Kyle! :)

  • @xuelianwang5300
    @xuelianwang5300 6 ปีที่แล้ว +5

    Very interesting JavaScript question! Thank you for sharing!! Thank you for taking time and effort to make so many nice JavaScript videos!

  • @subratkumar5901
    @subratkumar5901 7 ปีที่แล้ว +1

    I am following you since couple of months.. You are champ man. Keep it up.. 1000 likes from my side

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Hi Subrat, thanks for watching! :)

  • @nintichance
    @nintichance 6 ปีที่แล้ว +4

    I've been watching your videos over the past few days and they've been extremely helpful and informative!

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว +1

      Thanks for watching Ninti! :)

  • @ernestromen1479
    @ernestromen1479 9 หลายเดือนก่อน

    You helped me a lot in job interviews.
    Actually I am preparing for an interview right now with the help of your video.
    Thank you!

  • @tochukwuibe2139
    @tochukwuibe2139 6 ปีที่แล้ว +3

    Getting ready for my first interview, your content is really helpful

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว +1

      Good luck with your interview. !

  • @vladanng
    @vladanng 6 ปีที่แล้ว +1

    What a fantastic videos. I remember watching your one year ago it feel like nostalgia, because i spend hours and hours watching your videos, trying to understand things. For now, i did not find better one tutorials on JS stuff on youtube at least. Just fantastic.

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว +1

      Thanks for watching and welcome back !

  • @LolowBlazee
    @LolowBlazee 6 ปีที่แล้ว +8

    Love those tricky questions, we actually keep learning :)

    • @sammiliu2524
      @sammiliu2524 4 ปีที่แล้ว

      Great video, very useful

  • @astro-zodiac
    @astro-zodiac 2 ปีที่แล้ว +2

    6:10
    That's a cool trick to impress your co-workers,
    If they dont know it 😂😂

  • @babinicz91
    @babinicz91 6 ปีที่แล้ว +4

    Best Interview series!

  • @surferbum618
    @surferbum618 6 ปีที่แล้ว

    Thank you for helping strangers! I hope TH-cam does right by you and you can keep the videos coming. They're a great help.

  • @momentswithmanisha
    @momentswithmanisha 5 ปีที่แล้ว +3

    I learned new things. Thank you clearing my Concept 😇

  • @ParasFtl
    @ParasFtl 6 ปีที่แล้ว

    This is one of the best channel to advance your JavaScript.

  • @ryanlozon5712
    @ryanlozon5712 6 ปีที่แล้ว +7

    Please keep up the awesomeness.

  • @MrVisheshsingh
    @MrVisheshsingh 7 ปีที่แล้ว

    Thanks for the video. We all support you for all the hard work you are doing!

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Thanks for your support! :)

  • @jakekim1442
    @jakekim1442 6 ปีที่แล้ว +3

    Awesome tutorials man.

  • @SlayBellsMusic
    @SlayBellsMusic 2 ปีที่แล้ว

    I'm finding all your interview videos helpful. I have my first ever on Monday and feel much more confident going in.

  • @pavelerokhin1512
    @pavelerokhin1512 6 ปีที่แล้ว +22

    There is no inappropriate content in this video, dear TH-cam

  • @ollehbudiak7150
    @ollehbudiak7150 5 ปีที่แล้ว

    Thanks for your work.
    console.log(arguments.length);
    vs
    console.log([].slice.call(arguments).length);

  • @Toni7926
    @Toni7926 7 ปีที่แล้ว +3

    Nice video, keep up the good work! (:

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Thanks for the support ! )

  • @RajendraTaradaleBeHappy
    @RajendraTaradaleBeHappy 5 ปีที่แล้ว +3

    Thanks for tricky question - didn't aware of this magic

  • @ejikeezekwunem4162
    @ejikeezekwunem4162 2 ปีที่แล้ว

    What a great video. I had my hand over my head all the way. Like I would literally fail all the questions without your solutions. Thank you so much.

  • @SK-ur3hw
    @SK-ur3hw 7 ปีที่แล้ว +5

    Great interview questions 👍🏻

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Thanks for watching ! :)

    • @njcoutinho1
      @njcoutinho1 7 ปีที่แล้ว

      Wonderful to learn this. Thank you

  • @Fikayoz
    @Fikayoz 7 ปีที่แล้ว

    Thank you so much for this video! I hope this channel grows even larger!

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Thanks for your support Fikayoz!

  • @theinternetcash
    @theinternetcash 6 ปีที่แล้ว +3

    my first javascript interview coming up very soon

  • @ryanmfahey1
    @ryanmfahey1 6 ปีที่แล้ว

    This is very helpful. I am conducting JavaScript interviews in the next couple weeks. This has been a great resource (along with your other videos).

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Thank you for watching Ryan. Good luck with your interviews!

  • @vlad981
    @vlad981 7 ปีที่แล้ว +4

    Thanks! Great video!
    Hope TH-cam will change its policy, keep it up please)

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Thanks for the support ! )

  • @itsimpl6257
    @itsimpl6257 6 ปีที่แล้ว

    The reason you cited why the interviewer asks such weird questions are all very correct.

  • @ozzyfromspace
    @ozzyfromspace 2 ปีที่แล้ว

    @17.25, a more concise solution is: const x = (...rest) => rest.length;
    Awesome video, Techsith. I'm 100% subbed 🏆🎊. Most of these questions really had be thinking haha

  • @DevRaj-tk3kc
    @DevRaj-tk3kc 6 ปีที่แล้ว +1

    Nice tricky questions. These are proper genuine content videos.

  • @meetidnani
    @meetidnani 7 ปีที่แล้ว

    Thanks for your videos, they are really helpful.
    For the question related to number of arguments ...i could simply also do the below
    var y = function() {
    console.log(arguments.length);
    };
    y(1,2,3,4,5);
    Any specific reason for using [].splice ......

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      yes you could simply use arguments.length

  • @danielhughes3758
    @danielhughes3758 3 ปีที่แล้ว +1

    Thank you so much for this. It's interesting to hear your perspective on these tricky questions and I appreciate your openness and honesty about youtube monetization

  • @lolmos
    @lolmos 4 ปีที่แล้ว

    Dude I love the videos you're really helping me and many others on our Dev path

  • @karanveersingh6943
    @karanveersingh6943 6 ปีที่แล้ว

    Grear video! Always putting out worthwhile content😁

  • @shwetapaliwal2424
    @shwetapaliwal2424 5 ปีที่แล้ว +1

    seriously very much needed video for developers

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว

      Thank you shweta for a nice comment! :)

  • @bogdanbugnar7415
    @bogdanbugnar7415 3 ปีที่แล้ว

    This is great man! Keep on going!

  • @shawnmichaelalberto7519
    @shawnmichaelalberto7519 ปีที่แล้ว

    @3:26 now I fully understand how styled components work. You are such a good teacher

  • @alex_zan
    @alex_zan 6 ปีที่แล้ว

    Really helpful video! We need more of those on TH-cam!

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      I have a plan for more such videos. keep an eye on the channel for that.

  • @nancycreeksong9879
    @nancycreeksong9879 5 ปีที่แล้ว +2

    Techsith videos have been very useful to me. Thank you.

  • @ErnestGWilsonII
    @ErnestGWilsonII 7 ปีที่แล้ว +1

    I am already subscribed to your channel and I get alerts but I wanted to let you know that I really appreciate your content thank you for making videos and posting them for us!

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Ernest , Thanks you for watching! :)

  • @sanketatmaram
    @sanketatmaram 4 ปีที่แล้ว

    function a() {
    console.log(arguments.length);
    }
    Above will also work for arguments length.

  • @nitinagrawal6637
    @nitinagrawal6637 5 ปีที่แล้ว

    Appreciate & yes maximum people make a list of questions to ask from the internet for the interviews & then start expecting the answers for those questions from candidates & in reality maximum interviewers also dont have any freaking idea for those answers. But current interviews have become a race, a questions/answers session, a Viva.

  • @nishanth-saka
    @nishanth-saka 2 ปีที่แล้ว

    By far the best channel for learners!

  • @sufiyan0011able
    @sufiyan0011able 5 ปีที่แล้ว +1

    Thanks for making this video. Its a great help for guys like us.

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว

      Sufiyan, thanks for the comment.

  • @MrErererererr
    @MrErererererr 5 ปีที่แล้ว +2

    Thank you. I have my interview tomorrow and if I pass it, it thanks to you.

    • @jcmarquezgalvis
      @jcmarquezgalvis 5 ปีที่แล้ว

      Did you pass?

    • @ra5898
      @ra5898 5 ปีที่แล้ว

      Plg send me the question I don't have idea I prepared the interview my email id kamalrajawat870@gmail.com I have prepared in web development plg text all questions

  • @SketchStack
    @SketchStack 6 ปีที่แล้ว

    Awesome man. Want to see more interview tricky question series. Awesome job.

  • @curiouscristina
    @curiouscristina 6 ปีที่แล้ว

    You're awesome, your videos are helping me a lot. If I pass my interview tomorrow I'll become a patreon. Thank you very much!

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Good luck with your interview Andrea. :)

  • @adamcrap
    @adamcrap 6 ปีที่แล้ว

    Great content!! I am preparing for an interview in a couple days and your videos are a huge help!!

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      I am glad Adam . thanks for watching!

  • @swethavutukuru
    @swethavutukuru 4 ปีที่แล้ว

    u have gr8 knowledge on Javascript. I am learning a lot from u. I am looking forward for more technical videos from u.

  • @6keff
    @6keff 7 ปีที่แล้ว

    Excellent video!, I didn't knew about content editable property until now. Thanks!

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว +1

      yes, its a neat trick.:)

  • @balanepalaiyathane9714
    @balanepalaiyathane9714 4 ปีที่แล้ว

    Very nice and useful one. Techsith really helping the community...

  • @otavioaraujo4320
    @otavioaraujo4320 2 ปีที่แล้ว

    Amazing! The String constructor one was cool haha

  • @kuhim3753
    @kuhim3753 5 ปีที่แล้ว

    Best TH-cam channel for JavaScript interview

  • @ephdawg3374
    @ephdawg3374 6 ปีที่แล้ว +1

    Thanks for your videos, they are always so helpful. Learned some great things from this one !!

  • @PhotoLightTV
    @PhotoLightTV 6 ปีที่แล้ว +2

    techsith, your videos are amazing!

  • @Mr_BetaMax
    @Mr_BetaMax 5 ปีที่แล้ว

    I did not know about the contenteditable attribute!! It's awesome

  • @JB-pl8vj
    @JB-pl8vj 4 ปีที่แล้ว

    Thank you for taking the time to teach us! Cheers

  • @glendysfilsinger5473
    @glendysfilsinger5473 6 ปีที่แล้ว

    I am a new subscriber, and I can tell you that I love your content and videos... It is awesome!!! keep up the great work :)

  • @nunosantosdev
    @nunosantosdev 5 ปีที่แล้ว

    im glad you fixe YT problems for ads...your videos eally helpme a lot thanks👏

  • @Austin-ui8in
    @Austin-ui8in 3 ปีที่แล้ว

    Thanks for the great video, Techsith!

  • @ankitanand6596
    @ankitanand6596 6 ปีที่แล้ว

    You are doing a great job man... keep doing this..

  • @shridhargovindaiah
    @shridhargovindaiah 6 ปีที่แล้ว +1

    Excellent Video. We support you and we need more educational video from you.

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Thanks for watching Shridhar!

  • @sanjaysingh-sy6zu
    @sanjaysingh-sy6zu 5 ปีที่แล้ว +1

    Thanks for making this video which helps me understand tricky concepts of JavaScript. Thanks a bunch

  • @sistlavenkatesh2993
    @sistlavenkatesh2993 4 ปีที่แล้ว +1

    This video is important video for ui developers. Very informative video infact.

  • @miroslavspirkoski5623
    @miroslavspirkoski5623 6 ปีที่แล้ว +2

    Thanks a lot for this video, you are really unique with this content!

  • @sam123sujeet
    @sam123sujeet 5 ปีที่แล้ว +1

    Really like this tricky interview questions series. Keep posting it

  • @rajatsrivastava574
    @rajatsrivastava574 4 ปีที่แล้ว

    The way you explain the JavaScript are really awesome.

    • @Techsithtube
      @Techsithtube  4 ปีที่แล้ว

      Glad you think so! Thanks for watching!

  • @p2v515
    @p2v515 7 ปีที่แล้ว

    Amazing video! Like the job you do, good luck with it hope you stay motivated!!

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Thanks for the support ! )

  • @cautioni
    @cautioni 4 ปีที่แล้ว

    really appreciating the videos, thanks man.

  • @jeremybissonnette9403
    @jeremybissonnette9403 4 ปีที่แล้ว

    Super helpful video while Im studying for a job interview

  • @gouravgirdhar9973
    @gouravgirdhar9973 6 ปีที่แล้ว +1

    I'm grateful for all the effort you are putting in which makes learning so much easier. Thanks for all the hardwork

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Thanks for watching Grourav. I am gladthat it helped!

  • @SiddharthShivhare
    @SiddharthShivhare 3 ปีที่แล้ว

    This video is so important and you have shared very good questions with valid answers. Thanks a lot

  • @harikumargurudu5260
    @harikumargurudu5260 7 ปีที่แล้ว

    Thank you for your videos. We are with you and please keep on posting videos.

    • @Techsithtube
      @Techsithtube  7 ปีที่แล้ว

      Hari, Thank you for your support! :)

  • @aaaaaaa596
    @aaaaaaa596 6 ปีที่แล้ว

    Always nice content delivered !!!

  • @christmasvillage3652
    @christmasvillage3652 5 ปีที่แล้ว +2

    your videos are awesome and TH-cam is very discouraging. Keep up the good work sir.

  • @sathishkumarcisco
    @sathishkumarcisco 6 ปีที่แล้ว

    question : function return total number of arguments. // do not use loops.
    let x = function(){
    return [].slice.call(arguments).length;
    }
    Below one is more simple :
    let x = function(){
    return arguments.length;
    }

  • @discountmilakya6143
    @discountmilakya6143 5 ปีที่แล้ว +1

    Very informative video . it's really help me. Thank You Sir

  • @Michael-hj9fx
    @Michael-hj9fx 6 ปีที่แล้ว +1

    This was a very informative video. Thank you for creating it! I'll be sharing this with some of my programmer friends :)

    • @keshavgupta6549
      @keshavgupta6549 3 ปีที่แล้ว

      Where are you right now? Did you land at your first job? I am having an interview today.

  • @comparethetravel0com
    @comparethetravel0com 7 ปีที่แล้ว

    Adding the comment to let you know that I appreciate your effort to share you knowledge . Also subscribed

  • @yiyingw6506
    @yiyingw6506 6 ปีที่แล้ว

    I really like this series! I learnt a lot from watching these. Thank you!

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Thanks for watching Yiying! :)

  • @joyandlove7710
    @joyandlove7710 6 ปีที่แล้ว

    Thanks for the tips! I hope I am not running into any of the questions in my interviews, but it is so good to know.

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Its important to know these questions. Most of the times people wont ask such questions but you might one or two people who would ask such silly questions to throw you off.

  • @khusbookumari2149
    @khusbookumari2149 4 ปีที่แล้ว

    your videos are so important for any developer.

  • @debanjanbasu2597
    @debanjanbasu2597 6 ปีที่แล้ว

    I am just thankful to you from heart for these videos.

  • @Imjaffarkhan
    @Imjaffarkhan 5 ปีที่แล้ว +1

    Very well explained. Thanks Sith

    • @Techsithtube
      @Techsithtube  5 ปีที่แล้ว

      Thanks for watching Jaffer.

  • @funcomedy2
    @funcomedy2 ปีที่แล้ว

    Very interesting JavaScript question! Thank you for sharing!!

  • @CodersGyan
    @CodersGyan 4 ปีที่แล้ว

    One of the best tutorial :)

  • @alzz0
    @alzz0 5 ปีที่แล้ว +1

    Love yours videos tech sith

  • @dikshachavan9075
    @dikshachavan9075 6 ปีที่แล้ว +1

    you are great at teaching. very useful examples to understand js

    • @Techsithtube
      @Techsithtube  6 ปีที่แล้ว

      Thank you Diksha, Keep on learning!

  • @swethas7320
    @swethas7320 5 ปีที่แล้ว +2

    Good video to understand JavaScript concepts in depth

  • @vijaychachadi369
    @vijaychachadi369 2 ปีที่แล้ว

    Very helpful tips, you are the best mentor that i have ever seen

  • @andreybindyuk769
    @andreybindyuk769 5 ปีที่แล้ว +1

    Quite important and useful tutorial, many thanks!