Top 10 JavaScript Interview Questions

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • Top 10 commonly Asked JavaScript Interview Questions and its possible answers.
    For more interview questions checkout
    *www.fullstack....
    *My Udemy Courses
    www.udemy.com/...
    www.udemy.com/...
    Follow me for technology updates
    * / techsith
    * / techsith
    * / techsith1
    * / 13677140
    * / patelhemil
    Help me translate this video.
    * www.youtube.co...
    Note: use translate.goog... to translate this video to your language. Let me know once you do that so i can give you credit. Thank you in advance.

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

  • @shayhawkin
    @shayhawkin 3 года назад +177

    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  3 года назад +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 2 года назад +1

      Congratulations

    • @jishnudevroy592
      @jishnudevroy592 2 года назад +1

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

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

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

  • @dmytrodemydenko
    @dmytrodemydenko 6 лет назад +461

    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  6 лет назад +90

      Not all heroes wear suit.. Thanks :)

    • @justsomeguy8385
      @justsomeguy8385 5 лет назад +8

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

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

      Thanks

    • @ChristopherElwell
      @ChristopherElwell 4 года назад +11

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

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

      @@ChristopherElwell lol

  • @kartikgarasia5685
    @kartikgarasia5685 6 лет назад +76

    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

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

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

  • @kaidiesu8439
    @kaidiesu8439 5 лет назад +21

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

  • @vandhuymartins9481
    @vandhuymartins9481 6 лет назад +11

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

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

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

  • @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 5 лет назад

      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

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

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

  • @danghuy3035
    @danghuy3035 7 лет назад +12

    Just Found this channel... Amazingly helpful. Sub + like

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

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

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

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

  • @jankrodev3417
    @jankrodev3417 2 года назад +1

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

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

    50% Indians views all programing language video 📹 😅

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

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

    Always remember to repent of your sins (sin is transgression of YAHUAH The Father In Heaven’s LAW: Genesis, Exodus, Leviticus, Numbers, & Deuteronomy) And Have Belief On Yahusha The Messiah. HE Died and Rose three days later so that you can be forgiven of your sins!
    HE Loves you! Come to HIM🙂🙂🙂🙂🙂

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

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

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

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

    why dont we pass name in splitName, and how n is equal to name?

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

      @@amakauwa9724 Would .concat be acceptable too?

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

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

  • @ChristopherElwell
    @ChristopherElwell 4 года назад +7

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

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

    what is the difference between the two approaches below
    Approach 1
    *************
    const profile = {
    firstName: '',
    lastName: '',
    setName: function(name) {
    let splitName = function(n) {
    let nameArray = n.split(' ');
    this.firstName = nameArray[0];
    this.lastName = nameArray[1];
    }
    splitName(name);
    }
    };
    profile.setName('John Doe');
    console.log(firstName);
    console.log(lastName);
    Approach 2
    **************
    const profile = {
    firstName: '',
    lastName: '',
    splitName: function(name) {
    let nameArray = name.split(' ');
    this.firstName = nameArray[0];
    this.lastName = nameArray[1];
    }
    };
    profile.splitName('John Doe');
    console.log(profile.firstName);
    console.log(profile.lastName);

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

    Your voice is very low and difficult to understand what you are saying as your voice is low.

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

      I have updated my audiio equipment since than. thanks for pointing it out.

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

  • @Will-nj9un
    @Will-nj9un 3 года назад +1

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

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

      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?

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

    Eloquent Techsith :)

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

    These are actual interview questions? Seriously? Are you sure? Shouldn't the interviewer ask something that measures one's knowledge and prowess, and not the rudimentary basics of the 101 of the programming language? No-one that writes JS can fail these questions.

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

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

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

    Someone who is disabled I can get every question correct still not get the job.
    One reason why I record interviews and keep the EEOC's number on speed dail.

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

      Sorry to hear that, I think that is totally unfair. Feel free to share those company names so we boycott them.

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

    Only psychopaths use white code editor backgrounds.
    Jk. Nice video

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

    On train can't try but the first name arrowfunction if it said profile {this.furstnamr=firstname;
    That would work wouldn't be Window right

  • @Mi-rinconcito
    @Mi-rinconcito 2 года назад

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

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

    Don't you just love the error message "Assignment to constant variable"? It should say "assignment to a constant".

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

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

  • @kannanp.s8527
    @kannanp.s8527 3 года назад

    I don't believe sewag taking programming tutorial's

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

    starts at 1:15

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

    Var, let, const all get hoisted. The values for let and const do not get hoisted. Small quip

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

    JS interview series: ruclips.net/video/VcPH4FSxc7Y/видео.html

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

    Please note that all declarations (var, let, const, function, function*, class) are "hoisted" in JavaScript.

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

      Agree.
      The difference between var and let/const during hoisting is that JS initializes the var variables with 'undefined', while it does not initialize let/const variables which results in an error during run time.

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

  • @Avinashreddy.13
    @Avinashreddy.13 3 года назад

    Sir are u the one who has teached java script. Brad .in Udemy course.reply me.

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

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

    hi
    can you explain me this
    var arr = readLine().split(' ').map(arrTemp => parseInt(arrTemp, 10));

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

      split the string by charactor, and convert each element in the array to an integer.

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

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

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

    Variable means something can vary and constant by definition is not even a variable. It's constant.

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

    Well correct me if I'm wrong but let is also hoisted its just that it isn't initialized.

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

    varisables declared with var creates a property on the window object

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

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

    How are you getting the probability of one getting these questions in an interview?

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

    Thanks for the great video! Here questions from my interviews:
    github.com/wwwebman/front-end-interview-questions
    Maybe this will help someone

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

      That is a good one too. thanks for sharing!

  • @LBP-LearnByPractical
    @LBP-LearnByPractical 2 года назад

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

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

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

    can you make a tutorial on design patterns?

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

      Yes I am going to create some videos on design patterns.

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

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

    Let and Const both are hoisted but they will be in temporal dead zone

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

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

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

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

  • @guilhermeh.v.santos7424
    @guilhermeh.v.santos7424 Год назад

    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

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

    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.

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

    Thank you for the video, it is awesome.

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

    gotta love JS:
    v is undefined
    l is not defined
    and these are different lol

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

    var a = 10;
    var increment = function (a) {
    a = a+1;
    }
    increment(a);
    console.log(a);
    var a = {b:10};
    var increment = function (a) {
    a.b = a.b+1;
    }
    increment(a);
    console.log(a.b)
    can any one tell me diffrence between these two functios

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

      in the first case function (a) {
      a = a+1;
      }
      a is treated as a local variable, so it doesn't modify the global variable.
      but in the second case 'a' is object so while passing 'a', you are actually passing reference of 'a' so it modifies the value

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

      @@shivangiagrawal2207 thanks 👍🏿

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

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

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

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

    why are there all of this positive feedbacks for this super simple questions? you should not even think about taking a job interview if you don't know this topics

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

      Why you got to be so negative

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

    Both Let and var are hoisted but let not initialized

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

    didn't know variables have "definitions" that could be hoisted. those are called "declarations." eh

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

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

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

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

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

    best javascript i learn

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

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

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

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

    "Let" also gets hoisted buddy, but it's just kept in temporal dead zone.

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

      Technically there is no such thing as hoisting. When javaScript scans all the variables for a given block , its holds them for the block. Hosting is about weather that variable is available before its declaration. In using let its not because you get error. with let you get undefined. so we call variables defined with vars are hoisted.

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

    !0 is true in js.

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

  • @mohamedh.394
    @mohamedh.394 4 года назад

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

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

    Very useful information!

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

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

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

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

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

    @11:01 why this.firstName is set to window object?

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

    You are amazing at explaining things, thank you

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

    Really concise and on spot!

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw 4 года назад

    Bro ur pronunciation is bad

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

    Thank you so much sir ❤️

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

    Great video...Really knowledgeable 🙂

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

    👍👍👍

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

    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  3 года назад

      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.

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

    Loved it sir. Big fan of yours.

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

    Why is he always saying ocject while he wrote an array

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

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

  • @RahulJain-bb1kl
    @RahulJain-bb1kl 4 года назад

    wow JavaScript never been so easy to understand before