Top 10 JavaScript Interview Questions

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 386

  • @dmytrodemydenko
    @dmytrodemydenko 7 років тому +459

    what is the difference between "var" and "let" keywords? 1:15
    what is the difference between "==" and "===" signs? 3:54
    what is the difference between "let" and "const" keywords? 6:02
    what is the difference between "undefined" and "null" keywords? 9:06
    what is use of Arrow function? 10:01

    • @Techsithtube
      @Techsithtube  7 років тому +89

      Not all heroes wear suit.. Thanks :)

    • @justsomeguy8385
      @justsomeguy8385 6 років тому +8

      Thanks, I already know all of these answers so you saved me some time.

    • @swaroopaambatipati9223
      @swaroopaambatipati9223 5 років тому +1

      Thanks

    • @ChristopherElwell
      @ChristopherElwell 5 років тому +11

      Tutorial turns out to be a giant tutorial 11:47
      Tutorial turns out to be a giant tutorial 11:58

    • @seandeg
      @seandeg 5 років тому

      @@ChristopherElwell lol

  • @shayhawkin
    @shayhawkin 4 роки тому +176

    Today I got a job offer from an amazing company after passing their javascript interview questions. Luckily I watched your videos shortly before the interview which contained several of the questions you answered in your videos. Thank you techsith!

    • @Techsithtube
      @Techsithtube  4 роки тому +7

      Great News Shay 👍 , I am happy for you. Work hard and you will be successful.

    • @k.srinivash3rdbcac210
      @k.srinivash3rdbcac210 3 роки тому

      @shay Hawking what will know to clear javascript interview for freshers

    • @chhumchanleak7642
      @chhumchanleak7642 3 роки тому +1

      Congratulations

    • @jishnudevroy592
      @jishnudevroy592 2 роки тому +1

      please add your questions here.. it'll help a lot

    • @mralexander3289
      @mralexander3289 2 роки тому

      :)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

  • @kartikgarasia5685
    @kartikgarasia5685 6 років тому +74

    i they asked me 3 same questions.. just completed phone interview.. and it went not that bad thanks to you 🙌🏻

    • @swastiksahoo1595
      @swastiksahoo1595 4 роки тому

      I am unable to get how in the last example it would set it to window object.
      It is using splitname's this which does not have firstname property so it should throw an error.

    • @NeerajKumar-ll5kg
      @NeerajKumar-ll5kg 3 роки тому

      Ppppp

    • @NeerajKumar-ll5kg
      @NeerajKumar-ll5kg 3 роки тому

      Ppppppp

  • @orenciorodolfo1
    @orenciorodolfo1 3 роки тому +28

    thank you for the video!
    but I should point that both "let" and "var" are both always hoisted. The difference is that let gets hoisted to the block scope and remains uninitialized , that's why we get an error if we try to access it before its assignment. This is known as the "temporal dead zone". The same happens with "const".

    • @SuperStar-hh1ul
      @SuperStar-hh1ul 2 роки тому +2

      let and const keywords are not hoisted, but temporarily declared in the temporal dead zone, until they are initialized. To be precise, TDZ is the actual reason that contradicts the concept of hoisting in case of both keywords. TDZ is a fascinating topic for newbies, but one must understand its depth and absoluteness.

  • @tontran8670
    @tontran8670 4 роки тому +8

    Thanks to your Interview Questions video, it prepped me to land multiple Web Development jobs. I really appreciated it.

    • @rambaan2615
      @rambaan2615 3 роки тому

      😜😜😜😜😜😜 sarcasm at its best

  • @jawadahmed2520
    @jawadahmed2520 4 роки тому +4

    dude i highly respect you from the bottom of my heart . you are what they call an expert . i have request that please keep uploading such informative videos. thank you

  • @rambaan2615
    @rambaan2615 3 роки тому +1

    Those are the basics of JavaScript and a must know for everyone firsthand even before writing your first logical JavaScript program.

  • @U-Trance
    @U-Trance 5 років тому +8

    Started learning javascript couple months ago and this is quite helpful, thank you! (Especially the arrow)

    • @sharadruthib6134
      @sharadruthib6134 4 роки тому +2

      Let and const also gets hoisted not only var

  • @whatstrendingnow4211
    @whatstrendingnow4211 7 років тому +11

    sir what is the difference between callback function and promise .. they both run a function after they finish one.. let me try difference then you can correct me if I am Wong ..in callback function we can pass the argument of the previous function where as promise functions are independent functions. please reply

  • @vandhuymartins9481
    @vandhuymartins9481 7 років тому +11

    Finally after 10 videos I watched your and learned what closure is :)

  • @danninemx
    @danninemx 3 роки тому +4

    Update from 2021:
    2:28 - Incorrect statement. Variables declared with let and const get hoisted as well. They just do not get initialized in the same way as with var.

  • @charles-y2z6c
    @charles-y2z6c 5 років тому +1

    Excellent. I recently got a job which included Javascript. It was obvious to me that the interviewer watched this video. He tried to stump me and asked 6 of the questions. Thanks because I watched this video at least 10 times 👍

    • @Techsithtube
      @Techsithtube  5 років тому +1

      I am glad Charles you were able to answer the questions. Did you get the job?

    • @charles-y2z6c
      @charles-y2z6c 5 років тому +1

      techsith Yes i did, thanks again.

  • @yongzeyao1337
    @yongzeyao1337 5 років тому +4

    Just some addition. Arrow functions also do not have their own arguments, the value of arguments for arrow functions are taken from the outer lexical environment.

  • @jankrodev3417
    @jankrodev3417 2 роки тому +1

    Thank you for explaining after each question! This video is 5 Years old but still awesome!

  • @patrykjanik1706
    @patrykjanik1706 7 років тому +24

    In the second question (==/===) you are talking about effect of the comparison of these 2 operators not about them functionallity. Double equal sign also compare type but before it makes type coercion. Thats why === sign is faster than == sign.

    • @CarloRizzante
      @CarloRizzante 6 років тому

      Exactly, it's disheartening to see how many interviewers get this simple thing wrong. It denotes a lack of understanding on other parts of the language as well.

    • @achalchoudhary9864
      @achalchoudhary9864 5 років тому

      Could you explain bit more

    • @matchestheclown
      @matchestheclown 5 років тому

      He eludes to that around 5:20

  • @vstvlogs878
    @vstvlogs878 4 роки тому

    1) what is the difference between "var" and "let" keywords?
    : Var is with us since the beginig of js whereas dlet was introduced in js with es6 version of js,
    Other difference between var and let is that var has function scope and let has a block scope
    other diff
    Var can be hoisted at the top of its function where let doesnt get hoisted(ie let doesnt exist before its definition and exists from its definition till the end of the block)
    eg.
    if(true){
    console.log(v) --->undefined
    console.log(l) --->error
    var v=1;
    let l=2;
    }
    2)what is the difference between "==" and "===" signs? 3:54
    Both of these are comparison operators, but == will compare just the value and ignore type, whereas === will compare value and type
    eg.
    if("3"==3) ==>true if("3"===3) ===>false
    3)what is the difference between "let" and "const" keywords?
    you can not reassign const value, whereas for let you can even change its type, but in array
    const a=[1,2,3]
    a.push(4) is allowed
    a wil be a=[1,2,3,4]
    but you can not reassign it as a=[1,2,3,4]
    4)what is the difference between "undefined" and "null" keywords?
    When you define a variable but do not assign any value to it, js automatically assigns a placeholder to it as undefined(ie we do not assiign it as undefined)
    Whereas when we want to clean a value we would set it to null
    another imp diff is if we do
    console.log(typeof(undefined))--->undefined
    console.log(typeof(null))--->object

  • @kaidiesu8439
    @kaidiesu8439 6 років тому +20

    Got the interview today, exactly the second question be asked. I hoped earlier to see this video! 😭

  • @damianodamian7907
    @damianodamian7907 3 роки тому +1

    Hello, this video is really useful thank you for sharing it :) I've got a question: at 7:25 if you say that if we write “const c;” JavaScript will assign “undefined” to our constant why if we console.log(c) is returns: “Missing initialiser……” ?
    [shouldn’t it return “undefined” if we console.log(c)?]
    What does “Missing initialiser really mean"? That we’ve not assigned a value to our const yet?

    • @damianodamian7907
      @damianodamian7907 3 роки тому

      As far as I understand, when we use the keyword “const” while declaring a variable, an initialiser for the constant is required. We cannot just declare a variable with const we need to assign a value to it, isn’t it?

  • @Lerremy
    @Lerremy 5 років тому +1

    Thanks alot my Pakistani friend!
    I got my first IT interview ever tomorrow, wish me luck!

    • @Techsithtube
      @Techsithtube  5 років тому +1

      Good Luck with your interview.

  • @Ray-Zah
    @Ray-Zah 6 років тому +2

    Some questions from my interviews:
    1. How would you describe that even bubbling works?
    2. calc(1)(2) returns 3. How would you write that function?
    3. What do you know about ES7?
    4. What is a callback function and how would you write it?
    5. Adding an array to another array without using push. How would you do it?

    • @amakauwa9724
      @amakauwa9724 3 роки тому

      An instance of bubbling is when a click on a button nested inside a parent(div) that also has an on click event reacts to that click

    • @amakauwa9724
      @amakauwa9724 3 роки тому

      So the way to stop the propagation is by using the stopPropagatjon method

    • @amakauwa9724
      @amakauwa9724 3 роки тому

      No 5
      Use the spread operator
      Eg
      ... SecondArray

    • @twentyfivesouls
      @twentyfivesouls 3 роки тому

      @@amakauwa9724 Would .concat be acceptable too?

    • @twentyfivesouls
      @twentyfivesouls 3 роки тому

      yoooo got any more of those? Questions like these are addicting haha

  • @NikhilAdiga
    @NikhilAdiga 5 років тому

    Variables defined with let do get hoisted but they enter a time called temporal dead zone. When we declare a variable using var and try to print its value without assigning anything to it,it gives undefined as the output. But when we do the same thing using let it gives error. The time between assigning the value to be undefined and output is called as the temporal deadzone

  • @rodneyjames1438
    @rodneyjames1438 6 років тому +2

    You create very informative videos with examples that serve to illuminate rather than confuse the concepts at hand. Keep up the good work.

  • @rodneyjames1438
    @rodneyjames1438 6 років тому +1

    Nice video to augment all of the other great videos you create. One thing I noticed, and this is a technicality. When describing the difference between 'let' and 'var', you state that the definition of a 'var' is hoisted, but not the value. What you meant to say (I am certain) is that the DECLARATION is hoisted and not the definition. This is an important clarification that needs to be made. Keep up the good work!!

    • @Techsithtube
      @Techsithtube  6 років тому

      Good point. I will point that out in the description . Thanks for watching!

  • @jasonwelsh417
    @jasonwelsh417 6 років тому +3

    I love your content. I have a Front End technical interview this week - thank you so much for the great content to hep me prepare!

    • @Techsithtube
      @Techsithtube  6 років тому

      Good luck with your interview!

    • @ompandey4595
      @ompandey4595 3 роки тому

      @@Techsithtube please reply please
      I am learning web dev by my own so please reply
      Want to become frontend
      Leatnt html css bootstrap facing problem in js
      Please reply what topics I need to know for web dev or I need to learn whole
      Ple as per frontend web role

  • @pablitocodes
    @pablitocodes 3 роки тому

    I'm currently interviewing for new roles. Thanks for the tips.

  • @bl00dyJS
    @bl00dyJS 2 роки тому

    The difference between let and var is that , let's say that we will made a function , between we will made variable and there we will write "Hello world ".In the console will be a mistake because the visibility area of the let is in {} . Var has the global visibility and the local visibility , we can change the value of this varieble .This is simple question , but allright

  • @byronwang93
    @byronwang93 3 роки тому

    I know this is gonna get lost in a sea of comments but I just wanted to let you know that I passed my first co-op job javascript interview because of your videos! Thanks for everything! :)

  • @HareKrsn213
    @HareKrsn213 3 роки тому

    awesome video..thank you sir...but i observed one thing at time 7:58. the error stating “missing initialiser” it means when you declared the const at that time only you need to initialise it. It does not considers “undefined” as initialised value otherwise it would show “reassignment is not allowed” to const.
    please bridge the gap if it is so...

  • @ChristopherElwell
    @ChristopherElwell 5 років тому +7

    3:21 Not its 'definition', its 'declaration'. If its definition was also hoisted, it wouldn't be undefined.

  • @socco696
    @socco696 5 років тому +3

    Contrary to what you said, let and const are also hoisted to the top of the scope but without initialization and accessing it before initializing will throw a Reference Error.

    • @Techsithtube
      @Techsithtube  5 років тому

      Well if you look at that way. there is no such thing as hoisting. Hoisting is the word created by JavaScript community to explain the odd behavior of var. Its just way javaScript interpreter looks at things.

    • @broseph01
      @broseph01 5 років тому

      @@Techsithtube And here I thought I had that concept figured out. 😁 Much appreciated anyhow. Your content is very helpful. Hats off to you. 👏👏

    • @tejaswikaturi391
      @tejaswikaturi391 5 років тому

      There is something called temporal dead zone for let and const

  • @prashantjha7350
    @prashantjha7350 5 років тому +2

    All declarations (function, var, let, const and class) are hoisted in JavaScript, while the var declarations are initialized with undefined, but let and const declarations remain uninitialized.
    They will only get initialized when their lexical binding (assignment) is evaluated during runtime by the JavaScript engine. This means you can’t access the variable before the engine evaluates its value at the place it was declared in the source code. This is what we call “Temporal Dead Zone”, A time span between variable creation and its initialization where they can’t be accessed.

  • @tkimdev
    @tkimdev 4 роки тому +1

    Eloquent Techsith :)

  • @kyrieirving4206
    @kyrieirving4206 6 років тому

    A const declaration must have an explicit initialization
    If you want a const with the undefined value, you'd have to declare const c = undefined to get it.
    const c alone will throw a SyntaxError: Missing initializer in const declaration
    Reassign will throw TypeError: Assignment to constant variable.

  • @Will-nj9un
    @Will-nj9un 4 роки тому +1

    Thank you, this is really helping! WISH ME LUCK MY BROTHERS

  • @williamsdaduk
    @williamsdaduk 5 років тому +1

    I had an interview yesterday where I was asked about let and const and i also had the undefined and null question ... a new one for me was 'explain what promises are in javascript'

    • @vracaze
      @vracaze 5 років тому

      wtf is that

    • @shinx6668
      @shinx6668 5 років тому

      @@vracaze you'll learn it

  • @sumitkashyap1105
    @sumitkashyap1105 5 років тому

    i wish i had gone through this before, every single question were asked in my last interview, you rock !

  • @rahulchaube2898
    @rahulchaube2898 3 роки тому +2

    Hello,
    I have a quick question. Variables defined with 'let' are also hoisted. It's just that their initialisation to 'undefined' is not done in case of 'let'. Correct me If I am wrong. Thanks

    • @rashmidhande6234
      @rashmidhande6234 Рік тому

      I too was wondering with this....Let and const are also hoisted but they are in temporal dead zone

  • @PrinceKumar-no3uo
    @PrinceKumar-no3uo 4 роки тому

    Actually both the comparison operators "==" and "===" compare types and values both. The difference is the former allows dynamic type coercion and latter does not.
    Good video though, correct me if i am wrong :)

  • @LBP-LearnByPractical
    @LBP-LearnByPractical 2 роки тому

    Variable defined as let also get hoisted but not on a global execution context but in seprate space

  • @solmindaudy
    @solmindaudy 4 роки тому

    2:26 You said Let does not get hoisted. Where as it get hoisted and it will be in a temporal dead zone if you try to console it before initialization .

    • @Techsithtube
      @Techsithtube  4 роки тому

      getting temporal dead zone and hoisting is two different things. if you call variable before its definition it should give you and error. in case of let that is true. var will give you undefined instead of error. because its declaration is hoisted , not the value. Temporal dead zone is because if you define the same variable outside the block.

  • @techyleviathan2054
    @techyleviathan2054 6 років тому

    Okay hold on, I have a question. 11:10 What's the purpose of the second function inside of the other? A code like this:
    // setName : function(name) {
    // let nameArray = name.split(' ');
    // this.firstName = nameArray[0];
    // this.lastName = nameArray[1];
    // }
    would have the same effect, right? So what was that about?

    • @Techsithtube
      @Techsithtube  6 років тому

      Yuriy, this is just an interview question however in reality you may have a large method with duplicate functionality which you can abstract out to a common function.

  • @sahilarora7186
    @sahilarora7186 3 роки тому

    Loved it sir. Big fan of yours.

  • @mohamedmando3330
    @mohamedmando3330 3 роки тому

    Thanks for your for the video, but you mentioned that let isn't hoisting. But var, let and const they are all hoisted to the top of their scope. But while var variables are initialized with undefined, let and const variables are not

  • @HareKrsn213
    @HareKrsn213 3 роки тому

    you explains the concepts in a understandable way😊..thank you bro

    • @Techsithtube
      @Techsithtube  3 роки тому

      Happy to help! feel free to ask more questions ! :)

  • @redpilledworld
    @redpilledworld 3 роки тому

    Technically, all JS variables are hoisted. Where let and cost differs from var in the hoisting process is in the initialization part

  • @vimux
    @vimux 2 роки тому

    Just an additional info for arrow functions, regular functions are hoisted while arrow functions are not.

  • @EllaJust
    @EllaJust 4 роки тому +1

    You are amazing at explaining things, thank you

  • @notforever123
    @notforever123 7 років тому +6

    Best Javascript teacher on UA-cam.

  • @rajvallabhsoftware
    @rajvallabhsoftware 2 роки тому

    JS interview series: ua-cam.com/video/VcPH4FSxc7Y/v-deo.html

  • @vivekvanga3588
    @vivekvanga3588 7 років тому +4

    helped alot... waiting for part3...😃😃

  • @abhis3kh
    @abhis3kh 3 роки тому

    Great demonstration of using arrow function. Thanks man for teaching it.

  • @mayurdugar03
    @mayurdugar03 5 років тому +2

    Really concise and on spot!

  • @sumukhakb2701
    @sumukhakb2701 4 роки тому

    Today they asked about, diff between undefined and null, var and let, function scoped vs block scoped, how to display keys from object, how to delete keys from object, how to sort by name

    • @Techsithtube
      @Techsithtube  3 роки тому

      I hope you were able to answer the questions. Good luck with your interviews.

  • @imsheldlocked3386
    @imsheldlocked3386 7 років тому

    Very Useful !!!!
    Please create videos on below topic (ECMA-2015)
    Modules Value
    Export/Import
    Default & Wildcard
    Classes
    Class Definition
    Class Inheritance
    From Expressions
    Base Class Access
    Static Members
    Getter/Setter

    • @Techsithtube
      @Techsithtube  7 років тому +1

      THanks for the list. I will sure to create those tutorials .

  • @kramudu
    @kramudu 2 роки тому

    Very useful information!

  • @Mi-rinconcito
    @Mi-rinconcito 3 роки тому

    Tomorrow is my first interview for a Jr. Software Developer position. Wish my luck!

  • @harshshah5511
    @harshshah5511 Рік тому

    Techsith kaka🙌

  • @sarathhari_photography
    @sarathhari_photography 3 роки тому

    As per my understanding Let have functional and block scope and var have global scope and functional scope.

  • @abhis3kh
    @abhis3kh 3 роки тому

    Great video...Really knowledgeable 🙂

  • @logicbuffer2162
    @logicbuffer2162 7 років тому +12

    Good video. Except const c; is not assigned a value of undefined. It throws error.

    • @Techsithtube
      @Techsithtube  7 років тому +2

      Yes in the latest broser const c; would give error.

    • @31redorange08
      @31redorange08 6 років тому +5

      I call bullshit. The error message is clear. The behavior didn't change since you uploaded the video. Just admit it.

    • @raver8056
      @raver8056 6 років тому +2

      +31redorange08 dude he probably tried everything 5 times in the console before making the vid to be 100000% sure about everything. So i guess he is right xD

    • @nomtijorti
      @nomtijorti 6 років тому

      what do you think "missing initializer" means?

    • @ark333
      @ark333 5 років тому

      @@31redorange08 fuck you and stop harassing someone who put work into a video to help us, idiot

  • @relaxlearn4108
    @relaxlearn4108 3 роки тому

    Thank you for the video, it is awesome.

  • @christinejurewicz3057
    @christinejurewicz3057 6 років тому +4

    Thank you for the examples with each question. This is an excellent video!!

  • @ghostsOfWar13
    @ghostsOfWar13 4 роки тому

    let gets hoisted as well const get hoisted as well! They get hoisted differently that's all.Tthey go to the temporal dead zone and if you call them before the compiler reaches the variable you will get a reference error

  • @dijiflex
    @dijiflex 5 років тому +1

    you made me know some of the little things i had always assumed;

  • @LenTos1337
    @LenTos1337 5 років тому

    actually let get hoisted, just doesn't allow you to use it before it was "declared" in the scope

    • @itsUnsmart
      @itsUnsmart 5 років тому

      Hoisting is what allows you to use a variable before its declared in a scope... you should go look up a definition of javascript hoisting to understand what it means :)

  • @gamersoul1098
    @gamersoul1098 3 роки тому

    5:30 i think string will be converted to number right ?

  • @Deix25
    @Deix25 3 роки тому

    This was so helpful! Thank you!!!!!

  • @whambalamb
    @whambalamb 3 роки тому

    Thank you so much! Really love the quality of content you are providing for us!

  • @bobbybrown2023
    @bobbybrown2023 5 років тому

    9:25 I was told that "defining a variable" and "assigning a value to a variable" were the same thing? And that "declaring a variable" was just creating the existence of a variable, with or without a value e.g. var x;
    Where did I go wrong?

    • @BobbyBundlez
      @BobbyBundlez 5 років тому

      Jeff Donald you’re thinking of declaring a variable. Saying var foo; is declaring it but also technically defining it As undefined. Hope that makes sense...

  • @justadev____7232
    @justadev____7232 3 роки тому

    You said you shouldn't manually assign a variable undefined, just curious what the reason is behind it?

  • @swastiksahoo1595
    @swastiksahoo1595 4 роки тому +2

    I am unable to get how in the last example it would set it to window object.
    It is using splitname's this which does not have firstname property so it should throw an error.

  • @DanielDogeanu
    @DanielDogeanu 5 років тому

    3:54 The difference between "==" and "===" is wrong. Both check for type. The difference is that "==" attempts coercion, while "===" doesn't attempt coercion on your values.

    • @nolimits2017
      @nolimits2017 5 років тому

      He never said that one of them doesn't check for type. He said the "==" operator checks for type while the "===" operator checks for both value and type... which is correct.

    • @juanocasio8998
      @juanocasio8998 5 років тому

      He actually said the double equals does not check for type, which is incorrect. The first thing they both do is check for type. with === If the types are !=, then it returns false. With == if the types are the same, then it proceeds to process based on the strict equality rules. If not, it goes through a bunch of coercion steps to return true or false.

  • @manozkumar9618
    @manozkumar9618 7 років тому +1

    Your teaching amazing..

    • @Techsithtube
      @Techsithtube  7 років тому

      Manoz, thank you for watching! :)

  • @javiliyo69
    @javiliyo69 5 років тому

    best javascript i learn

  • @terraptr1448
    @terraptr1448 4 роки тому +1

    You are a legend, I was working on a project where I couldn't find the solution but it was simply instead of ===, use ==. 😂😂

  • @nayanjyotisharma1451
    @nayanjyotisharma1451 3 роки тому

    The let variable is also hoisted , why it does not print undefined answer to it is temporal dead zone concept , I guess you have to rectify that

  • @guilhermeh.v.santos7424
    @guilhermeh.v.santos7424 2 роки тому

    Thanks for sharing watching your other videos, the one that has this example console.log(7 > 6 > 5 ), console.log(5 < 6 < 7 ), made me think and and I just checked that console.log(true == 1) true as u said but also console.log(false == 0) --> true

  • @freetolisten
    @freetolisten 6 років тому +2

    this is so good and a lot of help. thank you!

  • @usamakhawaja8571
    @usamakhawaja8571 5 років тому +2

    starts at 1:15

  • @abhijitabhang1886
    @abhijitabhang1886 5 років тому +2

    I have a question which are regarding to comparison operator,
    null>0 --> false
    null==0 -->false
    null===0-->false
    null>=0-->true ?Why ? How ?

    • @immmmmmjimmy
      @immmmmmjimmy 5 років тому

      blog.campvanilla.com/javascript-the-curious-case-of-null-0-7b131644e274
      This might be helpful. tl;dr it's because of the algorithm that javascript uses when dealing with relational operators

  • @rajbannasa7662
    @rajbannasa7662 3 роки тому

    Thank you so much sir ❤️

  • @Drzfinest929
    @Drzfinest929 5 років тому

    "You ever hear the Tragedy of Darth Plagueis The Wise"
    Immediately thought about this when I read "tech sith" lol

    • @Techsithtube
      @Techsithtube  5 років тому +1

      Lol. I am a big star wars fan. :)

  • @sweetdoc1023
    @sweetdoc1023 7 років тому +1

    Wonderful... Very Clear and well explained.

  • @RahulJain-bb1kl
    @RahulJain-bb1kl 5 років тому

    wow JavaScript never been so easy to understand before

  • @dan-3268
    @dan-3268 5 років тому +1

    your videos are amazing! and so are you, sir!

  • @mohamedh.394
    @mohamedh.394 4 роки тому

    @02:18 Variables declared with let don't get hoisted? I thought they did get hoisted.

  • @priyasuryawanshi1143
    @priyasuryawanshi1143 3 роки тому

    Thank you so much!!!Can someone suggest me from where I should learn javascript from basic to advance.

  • @netindu
    @netindu 4 роки тому

    Great job buddy. You have a good presentation skill..

  • @nafeesahmed4942
    @nafeesahmed4942 7 років тому

    very nice explanation of each question with the example.

  • @MissionVivekananda
    @MissionVivekananda 7 років тому +6

    These questions really made sense... thanks :)

  • @sebabratakundu
    @sebabratakundu 2 роки тому

    I think the concept you told about 'let' is not true at some point. let are also hoisted but since js allocate completely different memory for let and we can't access those variables from that memory block before initialisation. Hence the error

  • @6613500
    @6613500 6 років тому +4

    Really helpful. Thanks a lot!

  • @gouravgoel2974
    @gouravgoel2974 4 роки тому

    11:15 what if we use var insted of let will it again set the window object

    • @Techsithtube
      @Techsithtube  4 роки тому

      if you use var instead of let there. you will have to bind to the object to use it.

  • @BharatBJ
    @BharatBJ 2 роки тому

    Let is also hoisted only difference is it goes to temporal dead zone

  • @yuvetteunderwood2716
    @yuvetteunderwood2716 5 років тому +3

    I like your concepts involved for preparation on Interview questions for Front-End User and other formats of interview questions. Being that I am refreshing my skills back into Technology filled, I finds these types of questions very helpful. Thank You!

  • @ermiasgio
    @ermiasgio 7 років тому

    Great video Techsith - thanks!

  • @madhan6816
    @madhan6816 5 років тому +1

    Hi indeed explain for this..var array=[1,2,3]; var [a=2,b]=array; console.log(a+""+b);. Op is 12

    • @Techsithtube
      @Techsithtube  5 років тому +1

      Madhan was this asked in an interview? its very simple [1,2,3] = [a,b] here a=1, b=2 so a+ "" + b = 12

    • @madhan6816
      @madhan6816 5 років тому

      @@Techsithtube yep...

    • @madhan6816
      @madhan6816 5 років тому

      How it comes..[1,2,3]=[a,b]

    • @Techsithtube
      @Techsithtube  5 років тому +1

      a=2 is just default param, which means if a is null a=2 but here [1,2,3] = [a,b] so a = 1, b=2

    • @madhan6816
      @madhan6816 5 років тому

      @@Techsithtube thanks bro

  • @OP-tw6bf
    @OP-tw6bf 6 років тому

    @techsith Thanks for the informative explanation. Regarding the difference between let and const, what is the purpose of 'if (true) { ... }'. Is to mimic a function scope?

    • @Techsithtube
      @Techsithtube  6 років тому +1

      if(true) {} creates a block scope. you can only create function scope by using a function.

  • @Noble_1776
    @Noble_1776 7 років тому +4

    One more difference between var and let is var can also be re-declared and let can not. I think the whole reason const and let were brought in with es6 was to try and take away some of the flexibility of declaring variables when it comes to mutability. We still have mutability with let but it is MUCH more controlled now. You really shouldn't use var.. but if you insist at the very least "use strict" because things like hoisting and unwanted mutability can get you in trouble.. also strict mode won't always save you. You can redeclare variables in it... awful.

  • @saritajha1
    @saritajha1 6 років тому

    Hi Techsith could you please explain following code ?? I have been asked in one of the interviews for the output -
    function parent() {
    var numOne = 1;
    function child(){
    var numTwo = 2;
    }
    console.log("numOne and numTwo are ", numOne , numTwo );
    }
    parent();
    Thanks in advance

    • @Techsithtube
      @Techsithtube  6 років тому +1

      mumTwo is inside child() so its not accessed outside to you will get numTwo is not defined error.