JavaScript if else (tutorial)

Sdílet
Vložit
  • čas přidán 5. 08. 2024
  • JavaScript if else made simple.
    🔥Get the COMPLETE course (83% OFF - LIMITED TIME ONLY): bit.ly/2M1sp4B
    Subscribe for more videos:
    / @programmingwithmosh
    Want to learn more from me? Check out my blog and courses:
    programmingwithmosh.com
    / programmingwithmosh
    / moshhamedani

Komentáře • 103

  • @Memoriasxvida
    @Memoriasxvida Před 3 lety +31

    You made this seem so simple. My head hurts from trying to understand it and you just saved me a headache. Thank you!

  • @brikozub
    @brikozub Před 4 lety +16

    That use of notes being interpreted into the structure of the language was incredibly helpful.

  • @idorenyinbenson1161
    @idorenyinbenson1161 Před rokem

    Mosh, you have also played a vital role in my Frontend Tech Career.
    Thanks

  • @burtcocain1986
    @burtcocain1986 Před 7 měsíci

    Brilliant! Doing prep for a bootcamp and they're asking me to do greetings at various times in various countries. Your vid has helped me get the solution, then simplify the solution. Onto Switch and Case now to pare it down further. Great vid.

  • @codewithsehran
    @codewithsehran Před 4 měsíci +1

    this guy,,
    i started my coding journey from teaching of this guy take love ❤

  • @TNCG
    @TNCG Před 4 lety +1

    I needed this video so bad! Helped so much!

  • @funhole26
    @funhole26 Před rokem +5

    I'm doing theodinproject and this was a good supplemental video to the conditional statements section in foundations. I also appreciated how you encouraged everyone to write the other two statements. Thanks.

    • @tristantrillo6239
      @tristantrillo6239 Před rokem +2

      I'm exactly on that same lesson in TOP and my brain hurt from it being so text heavy hahaha good luck on your learning journey!

    • @javierleduc9628
      @javierleduc9628 Před rokem

      @@tristantrillo6239 @funhole26 how have you guys been doing? just reached that part myself

    • @Anti-CitizenOne
      @Anti-CitizenOne Před 4 měsíci

      @@javierleduc9628 I know this is a late reply but I just reached that part of the project myself! The landing page was a blast and a good test of my skills up to this point. This video helped me out a lot as well. I hope everyone is doing well!

  • @aminimani5649
    @aminimani5649 Před 5 lety

    hey mosh there is an empty field in your courses for html css , We love you man , you are awesome

  • @nissangamba
    @nissangamba Před 2 lety +3

    Wow. you made it so simple. thanks a lot.

  • @Nexils
    @Nexils Před 2 lety +1

    Thank you so much for giving the little assignment in between so we can pause the video to try it ourselves. Really useful that you actually make me think for a little.

  • @vardar2191
    @vardar2191 Před 3 lety

    I payed for udemy which there were a lot of facts that I couldnt get, but thiss channel helps me even better. gush

  • @matthewl7540
    @matthewl7540 Před 2 lety

    You are amazing! Very well explained !

  • @htlkmsi2775
    @htlkmsi2775 Před 5 měsíci

    Simple and short. U re awesome!😁

  • @phetervincentdelmundo2274

    thank you so much, I need this.

  • @chinmayp5859
    @chinmayp5859 Před 2 lety

    Thank You So much Mosh

  • @yasineapdillaahi2731
    @yasineapdillaahi2731 Před rokem

    thanks 😊 Mr mosh very explained explained and understandable 👏

  • @Tom-xy9gb
    @Tom-xy9gb Před 2 lety

    I was having trouble understanding this, but thank god for youtube

  • @ktembhare5978
    @ktembhare5978 Před 3 lety

    Great course I love it

  • @abhiramvegesna7690
    @abhiramvegesna7690 Před 4 lety

    Thankk you so much it helped me alot

  • @ayMillmusic
    @ayMillmusic Před 9 měsíci

    Great video! Thank you! How come we don't need the curly brazes though?

  • @tusharnawal1562
    @tusharnawal1562 Před rokem

    I am from non technical background but its really helpful video for me...thanks

  • @StrayFei
    @StrayFei Před 4 lety +70

    Yanderedev must have watched this video

  • @jonathanyoung2588
    @jonathanyoung2588 Před rokem

    Mosh, you have the best tutorials I have found so far. Ive been working through Javascript and the concepts seemed outside of my understanding, but you explain in such an approachable way, it makes it almost easy. Cheers to you, my friend

  • @amjadali-cs3si
    @amjadali-cs3si Před 3 lety

    sir which exyention use it you in visual code your code is osm to write

  • @asifali-mw6cy
    @asifali-mw6cy Před 2 lety

    great explanation

  • @fabienpath
    @fabienpath Před 2 lety

    Is there a way to add other statement to an if like python or c++
    Example, statement and statement, statement or statement

  • @pabloernest5974
    @pabloernest5974 Před 3 měsíci

    Thank u so much

  • @daddySAL
    @daddySAL Před rokem

    thank you for the explanation, but I have a question why did you put 18 ? instead of 6 pm and for the first condition why didn't you put am or pm

  • @rajibdesai
    @rajibdesai Před 2 lety

    awesome..... from bangladesh...tnx

  • @joshualerman412
    @joshualerman412 Před 4 lety

    the 18 is army time correct ? which represents 6?

  • @elidapacheco9536
    @elidapacheco9536 Před rokem

    Great explanation, thank you!! Except the part where you recommended to remove curly braces threw me off, I thought curly braces were good practice?

  • @kalki-avatar
    @kalki-avatar Před rokem

    I am German, and my english is not good. Before i saw an german explanation. I understand nothing😅 But your explain this very clear, and i understand all. Thank you very much🎉

  • @Happiest_Bat
    @Happiest_Bat Před rokem

    how do you get that white console that you have on the right side of your screen?

  • @reecedowns3090
    @reecedowns3090 Před 3 lety

    How do you you save and open this?

  • @williamhastings4491
    @williamhastings4491 Před 3 lety

    I am solely interested in using Java Script with Adobe CD PRO is this the right platform.?

  • @carolinach9114
    @carolinach9114 Před 2 lety

    thanks friend !!

  • @mystickid1
    @mystickid1 Před 6 lety +6

    Does Javascript have a new spec where you can omit the curly braces now for code blocks? Never saw this before.

  • @syntychemanda846
    @syntychemanda846 Před 3 lety

    Thanks!

  • @OmerMD
    @OmerMD Před 3 lety

    Thanks buddy

  • @stacyhackney6100
    @stacyhackney6100 Před rokem

    Thank you.

  • @bettyann92
    @bettyann92 Před rokem

    Mosh, is your internal video setting set to Dutch only? I don't have other option other than Dutch. Nonetheless, great video.

  • @Mari741s
    @Mari741s Před rokem

    How do your connect this code to a text? Like.. if you want to change a text from weekday to weekday?

  • @noeliaflorenino4478
    @noeliaflorenino4478 Před 2 lety

    you made it look really easy thank you.

  • @rahulchauhan496
    @rahulchauhan496 Před 5 lety +1

    Sir how to create a chatbot using HTML and js...?? Sir I think its possible.. Using if else...
    Create 1st case and the answer and the other case and answer...

  • @sudiptasharma3005
    @sudiptasharma3005 Před 3 lety

    The link of the complete course isn't opening.

  • @isaacpalacios8921
    @isaacpalacios8921 Před rokem

    Wonder what is your Visual Studio Code theme

  • @chevvvv
    @chevvvv Před 2 lety

    why isnt the complete course link working?

  • @ayac6495
    @ayac6495 Před rokem

    link to the last section of operators ?

  • @mdhamzabiswas5295
    @mdhamzabiswas5295 Před 9 měsíci

    very nice video

  • @samuelb.5153
    @samuelb.5153 Před 3 lety +2

    is this possible to setup a caracters chain as a condition? ("if x = chair...")

    • @rush2325
      @rush2325 Před 2 lety +1

      If you set the char. chain as a number like so:
      [char chain] == [insert number here]
      ... then yes.

  • @abhilashasahay5490
    @abhilashasahay5490 Před 2 lety

    Can you pls do one in Windows OS

  • @ManBehindTheBurger
    @ManBehindTheBurger Před 2 lety

    This guy made college so much easier

  • @ralphsevilla3208
    @ralphsevilla3208 Před 4 lety

    how do i make it go in a 24 hour clock...cause when i made mines it was 7pm, and the code understood anything from 6 - 12 it will say Good morning.....But it is suppose to say Good Evening

    • @grifferkay9253
      @grifferkay9253 Před 4 lety +1

      just use a 24 hr clock time or declare your variables with 'am' and 'pm'

  • @FingerprintGamer
    @FingerprintGamer Před 3 lety

    In any languege If...Else is my favourite topic

  • @georgegeorgio70
    @georgegeorgio70 Před 3 lety +3

    4:35 ilse ef :D

  • @happyco6242
    @happyco6242 Před 2 lety

    which programming language you are using? can you name it please? Thank you very much for the videos it helps a lot....

  • @nour3660
    @nour3660 Před 2 lety +1

    JavaScript is just concepts, if you understand the concepts and logic behind lines of code, you will master JavaScript easily

    • @Yancyik
      @Yancyik Před 2 lety +1

      help me man im goign insane

    • @kwamegyasi508
      @kwamegyasi508 Před 2 lety

      would like to relate... I'm stuck in the concepts and logic behind the codes so it's really challenging

    • @nour3660
      @nour3660 Před 2 lety

      @@kwamegyasi508 it takes practice bro, take your time, im not perfect in JavaScript either

    • @jathebest2835
      @jathebest2835 Před rokem

      Coming from learning Python first(+a bit of C), learning JS is easy :) Maybe getting used to the syntax will take a while but except that, the programming logic is not different.

    • @nour3660
      @nour3660 Před rokem

      @@jathebest2835 yes pretty much, obviously some people learn slower or faster than others but yeah it will be fast to learn if you know a similar programing language

  • @tkimdev
    @tkimdev Před 3 lety +1

    so I don't need curley braces? what's the point of it then?

    • @muhamd6768
      @muhamd6768 Před 3 lety

      1:17
      for multiple statements in a condition

  • @Moviesshapeminds
    @Moviesshapeminds Před 4 lety

    easy to learn awesome

  • @akbarhosenpersonal
    @akbarhosenpersonal Před 3 měsíci

    Please help..🚫🚫 need the next video link about the switch statement...

  • @nrgking1667
    @nrgking1667 Před 2 lety

    wait what when i do this on replit nothing shows up on my screen after i code it. Everytime i try to code i keep on getting Failed to load resource: the server responded with a status of 404 () when i look at developer tools what does this mean?

  • @vijaybharathi.s3524
    @vijaybharathi.s3524 Před rokem

    In else statement didn't used of curly braces

  • @dhanunjay9035
    @dhanunjay9035 Před 7 měsíci

    Why did you take let hour =10

  • @nickrkr
    @nickrkr Před rokem

    This may sound silly, but can anyone help me understand why the variable was set to 10?

    • @mastersugu
      @mastersugu Před rokem

      when you change it based on the time it says"good morning" because 10am it is.

  • @FingerprintGamer
    @FingerprintGamer Před 3 lety

    Someone inform Google bout this guy.

  • @indirelinikole
    @indirelinikole Před 3 lety +10

    This is how YandereDev coded Yandere Simulator

    • @user-ed6go6xl8x
      @user-ed6go6xl8x Před 3 lety

      I don't get it

    • @indirelinikole
      @indirelinikole Před 3 lety +1

      @@user-ed6go6xl8x He codes like else if else if else if else if and calls people bad coders, he also lies about working on his game 6 hours a day

    • @user-ed6go6xl8x
      @user-ed6go6xl8x Před 3 lety

      @@indirelinikole oh ew. Thanks for explaining

    • @indirelinikole
      @indirelinikole Před 3 lety

      @@user-ed6go6xl8x No problem

  • @annabelleklein2525
    @annabelleklein2525 Před 4 lety

    when i put else if it says not valid wtff

  • @deskyee
    @deskyee Před 3 lety

    Try-
    let hour = 27;

  • @bulaloitech
    @bulaloitech Před rokem

    Python but longer syntax

  • @fixtechtv
    @fixtechtv Před 8 měsíci

    Why. Or isn't working. ||

  • @12KTOYOTA
    @12KTOYOTA Před 7 měsíci

    ctrl + F
    "yandere"

  • @grifferkay9253
    @grifferkay9253 Před 4 lety

    //you try this also
    let hour = parseInt(prompt("Enter time"))
    if(hour >= 6 && hour = 12 && hour = 18 && hour

  • @user-shiva996
    @user-shiva996 Před 3 měsíci

    Like

  • @PlatoOnnPluto
    @PlatoOnnPluto Před 3 lety

    Help I'm dumb

  • @omarnaser8291
    @omarnaser8291 Před rokem

    this was Terrible example

  • @yousufisalm4165
    @yousufisalm4165 Před 2 lety

    console.log("So Good method");