Tricky JavaScript interview questions and answers

Поделиться
HTML-код
  • Опубликовано: 19 дек 2024

Комментарии •

  • @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.

  • @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

  • @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;

  • @astro-zodiac
    @astro-zodiac 2 года назад +2

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

  • @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(....).

  • @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❤

  • @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!

  • @shawnmichaelalberto7519
    @shawnmichaelalberto7519 Год назад

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

  • @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 :-)

  • @ollehbudiak7150
    @ollehbudiak7150 5 лет назад

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

  • @rojiherrera
    @rojiherrera 7 лет назад +21

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

  • @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!

  • @nintichance
    @nintichance 6 лет назад +4

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

  • @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.

  • @tochukwuibe2139
    @tochukwuibe2139 6 лет назад +3

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

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      Good luck with your interview. !

  • @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! :)

  • @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!

  • @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.

  • @LolowBlazee
    @LolowBlazee 6 лет назад +8

    Love those tricky questions, we actually keep learning :)

  • @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

  • @momentswithmanisha
    @momentswithmanisha 5 лет назад +3

    I learned new things. Thank you clearing my Concept 😇

  • @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 !

  • @babinicz91
    @babinicz91 6 лет назад +4

    Best Interview series!

  • @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

  • @RajendraTaradaleBeHappy
    @RajendraTaradaleBeHappy 5 лет назад +3

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

  • @ryanlozon5712
    @ryanlozon5712 6 лет назад +7

    Please keep up the awesomeness.

  • @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!

  • @pavelerokhin1512
    @pavelerokhin1512 6 лет назад +22

    There is no inappropriate content in this video, dear RUclips

  • @MrVisheshsingh
    @MrVisheshsingh 7 лет назад

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

  • @jakekim1442
    @jakekim1442 6 лет назад +3

    Awesome tutorials man.

  • @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 RUclips should not harm you.

  • @Toni7926
    @Toni7926 7 лет назад +3

    Nice video, keep up the good work! (:

  • @surferbum618
    @surferbum618 6 лет назад

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

  • @SK-ur3hw
    @SK-ur3hw 7 лет назад +5

    Great interview questions 👍🏻

  • @Mr_BetaMax
    @Mr_BetaMax 5 лет назад

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

  • @theinternetcash
    @theinternetcash 6 лет назад +3

    my first javascript interview coming up very soon

  • @lolmos
    @lolmos 4 года назад

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

  • @vlad981
    @vlad981 7 лет назад +4

    Thanks! Great video!
    Hope RUclips will change its policy, keep it up please)

  • @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.

  • @ParasFtl
    @ParasFtl 6 лет назад

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

  • @itsimpl6257
    @itsimpl6257 6 лет назад

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

  • @kamoroso94
    @kamoroso94 6 лет назад

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

  • @sanketatmaram
    @sanketatmaram 4 года назад

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

  • @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 4 года назад

      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

  • @bogdanbugnar7415
    @bogdanbugnar7415 3 года назад

    This is great man! Keep on going!

  • @6keff
    @6keff 7 лет назад

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

  • @Fikayoz
    @Fikayoz 7 лет назад

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

  • @Lifeisfun2820
    @Lifeisfun2820 5 лет назад +1

    This video is great but and your explanation is good.
    I really did't understand the concept of asking these kind of questions in interview. Until and unless you faced these kind of scenarios in real time you never know the answer. I do have some decent experience like 6+ in JS but I faced these situations very rare when we work on framework. (9 out of 10 developers dont remember things after fixing an issue)
    So if some one answered these kind of questions means they saw these videos(assume {some number} out of 10) or read somewhere. So what are you interviewing real time experience or some interview preparation ?
    As an interviewer I will ask concepts(not these tongue twisters). architecture of application/framework and mainly approach on solving problem and wiling to learn.

  • @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.

  • @otavioaraujo4320
    @otavioaraujo4320 2 года назад

    Amazing! The String constructor one was cool haha

  • @alex_zan
    @alex_zan 6 лет назад

    Really helpful video! We need more of those on RUclips!

    • @Techsithtube
      @Techsithtube  6 лет назад

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

  • @DevRaj-tk3kc
    @DevRaj-tk3kc 6 лет назад +1

    Nice tricky questions. These are proper genuine content videos.

  • @SketchStack
    @SketchStack 6 лет назад

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

  • @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! :)

  • @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

  • @sufiyan0011able
    @sufiyan0011able 5 лет назад +1

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

  • @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;
    }

  • @shridhargovindaiah
    @shridhargovindaiah 6 лет назад +1

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

  • @JB-pl8vj
    @JB-pl8vj 4 года назад

    Thank you for taking the time to teach us! Cheers

  • @jeremybissonnette9403
    @jeremybissonnette9403 4 года назад

    Super helpful video while Im studying for a job interview

  • @Austin-ui8in
    @Austin-ui8in 3 года назад

    Thanks for the great video, Techsith!

  • @atmansangeethamani5373
    @atmansangeethamani5373 6 лет назад

    Hi Sir, Your javascript interview part of videos are very helpful. actually I have found an another way in that question of function return total number arguments
    you have explained like
    function x(){
    return [].slice.call(argunments).length;
    }
    x(1,2) // 2 length
    Found another way is
    arguments is a array like object
    it has number of array of arguments of function
    function x(){
    return arguments.length;
    }
    x(1,2,3) // 3
    simply we return arguments.length that will give lenght of arguments of function
    am getting answer for this way too..
    Thanks once again sir.

  • @nancycreeksong9879
    @nancycreeksong9879 5 лет назад +2

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

  • @balanepalaiyathane9714
    @balanepalaiyathane9714 4 года назад

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

  • @kurisuisaway
    @kurisuisaway 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. :)

  • @SiddharthShivhare
    @SiddharthShivhare 3 года назад

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

  • @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!

  • @debanjanbasu2597
    @debanjanbasu2597 6 лет назад

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

  • @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.

  • @ankitanand6596
    @ankitanand6596 6 лет назад

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

  • @sanjaysingh-sy6zu
    @sanjaysingh-sy6zu 5 лет назад +1

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

  • @devolee8302
    @devolee8302 5 лет назад +2

    'Document.body.cotentEditable = "true" ' is super cool !!!

    • @Techsithtube
      @Techsithtube  5 лет назад

      Yes first time i saw contentEditable I was blown away. :)

  • @funcomedy2
    @funcomedy2 Год назад

    Very interesting JavaScript question! Thank you for sharing!!

  • @myrna-a4gh45
    @myrna-a4gh45 6 лет назад

    Some of these tricky questions I have never seen before... thanks!

  • @comparethetravel0com
    @comparethetravel0com 7 лет назад

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

  • @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!

  • @dikshachavan9075
    @dikshachavan9075 6 лет назад +1

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

    • @Techsithtube
      @Techsithtube  6 лет назад

      Thank you Diksha, Keep on learning!

  • @kuhim3753
    @kuhim3753 5 лет назад

    Best RUclips channel for JavaScript interview

  • @aakritigangwal7659
    @aakritigangwal7659 7 лет назад +2

    Thankful for good bunch of Interview questions ons JS.

  • @SebastianWeszler
    @SebastianWeszler 6 лет назад

    Thanks for this video, it helped me understand JS better

  • @shwetapaliwal2424
    @shwetapaliwal2424 5 лет назад +1

    seriously very much needed video for developers

    • @Techsithtube
      @Techsithtube  5 лет назад

      Thank you shweta for a nice comment! :)

  • @ephdawg3374
    @ephdawg3374 6 лет назад +1

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

  • @vickykumar-fb8td
    @vickykumar-fb8td 6 лет назад

    Thanks a lot tecsith for interview series, question explained here are difficult to get on web that come as a surprise in interviews.

    • @Techsithtube
      @Techsithtube  6 лет назад

      JavaScript interviews are getting tougher by the day. I hope this helped. Thanks for watching vicky!

  • @nishanth-saka
    @nishanth-saka 2 года назад

    By far the best channel for learners!

  • @vijaychachadi369
    @vijaychachadi369 2 года назад

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

  • @indianhikinggirl
    @indianhikinggirl 5 лет назад +1

    Please come up with more videos of this type. It would be very helpful for interviews. Thanks

    • @Techsithtube
      @Techsithtube  5 лет назад

      I have a whole series of such videos. do check it out the playlist

  • @nitingais5187
    @nitingais5187 4 года назад

    This is very helpful to understand JavaScript internal technical execution and it's improve my knowledge

  • @sunnychaudhary35
    @sunnychaudhary35 4 года назад +1

    superb tricky questions. thank you so much and it is really appreciable.

  • @vinkrins
    @vinkrins 6 лет назад

    Great and to the point questions, thanks for your videos

  • @dennissuding4452
    @dennissuding4452 3 года назад

    Great video, explains Javascript interview questions tricky ones

  • @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!

  • @rajatsrivastava574
    @rajatsrivastava574 4 года назад

    The way you explain the JavaScript are really awesome.

    • @Techsithtube
      @Techsithtube  4 года назад

      Glad you think so! Thanks for watching!

  • @daqi-media
    @daqi-media 7 лет назад

    gave me a new level on JS. nice job!

  • @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! :)

  • @cemiluzunhasan1366
    @cemiluzunhasan1366 3 года назад +1

    I'm studying my interview with your videos. If I pass, I will edit my comment and I hope it's going to be well because the videos are very great. The contents are preparing the audience to the tricky and hard questions. Especially the ones that include mock interviews. Keep it going!

  • @sam123sujeet
    @sam123sujeet 5 лет назад +1

    Really like this tricky interview questions series. Keep posting it

  • @swethas7320
    @swethas7320 5 лет назад +2

    Good video to understand JavaScript concepts in depth

  • @aaaaaaa596
    @aaaaaaa596 6 лет назад

    Always nice content delivered !!!

  • @Imjaffarkhan
    @Imjaffarkhan 5 лет назад +1

    Very well explained. Thanks Sith