#17 How to use the JS Math object | JavaScript Full Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 พ.ย. 2024
  • 🙂 SUBSCRIBE - hit the bell 🔔 and choose all: goo.gl/nYLZvz
    In this lesson let's learn all about the built in Math object, the Math object contains math properties and methods that are used to do some really cool things such as generate random numbers an find the min and max values from a list.
    ------------------
    👍 HTML FULL TUTORIAL: shorturl.at/fiCMV
    👍 CSS FULL TUTORIAL: shorturl.at/clGSZ
    ------------------
    FACEBOOK: / devdreamercode
    TWITTER: / devdreamercode
    SUBSCRIBE and hit the BELL NOTIFICATION 🔔: goo.gl/nYLZvz
    ------------------
    Learn with Dev Dreamer! Step by step, easy to understand tutorials :-)

ความคิดเห็น • 22

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

    i struggled with the math object for a while but after watching this video i managed to smash the challenges thank you very much you are a brilliant teacher

  • @Starryskies-l9s
    @Starryskies-l9s 16 วันที่ผ่านมา +1

    Definitely helpful. Thank you!

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

    🎉❤ I can't believe i just write my own code for the first time of my own and thank you so much❤😊 for the lesson

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

    You explain easy 🎉, thank you, i need this kind of teacher.

  • @vaibhavmevada9668
    @vaibhavmevada9668 3 ปีที่แล้ว +2

    Thank you sir for making the video on javascript 👍

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

      Hey Vaibhav, thank you for watching! 🙂👍

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

    Thank you, I loved this video. Coupled with some docs on MDN, it's very very good.

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

    Maybe I've misunderstood something, but I feel like Math.random().toFixed(1) * 10 creates numbers between 0 and 10. Not 1 and 10.
    Great video, btw! Loving the series so far.

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

      Instead, I would write something like
      Math.random().toFixed(1) * 9 + 1

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

      Hey Alejandro, thank you so much for watching, really glad you are enjoying the series!
      You are right 👍it would be 0-10. Your suggestion would return 1-10 but not as whole numbers. To get 1-10 as whole numbers we should be using Math.floor() like so: Math.floor(Math.random() * 10 + 1)
      Thanks again for watching, do you think the tasks at the end of the lessons are helpful? 🙂👍

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

      @@DevDreamer You're absolutely right!
      In general, one would write something like this:
      Math.floor(Math.random() * (upperBound - lowerBound + 1) + lowerBound)
      Where upperBound and lowerBound are integers (10 and 1 respectively in your example).
      I've had some experience writing JS for personal projects (I'm more of a Python kinda guy) and so I usually skip those exercises, but I do believe they could be valuable to someone who has just started coding!
      Keep up the good work!! It amazes me how quickly you manage to release these videos.

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

    You make JS easier than easy

    • @DevDreamer
      @DevDreamer  2 ปีที่แล้ว +1

      Thanks Rema, really glad you’re finding them useful and easy to understand. Practice and repetition is the key 👍

  • @elikpornu
    @elikpornu 8 หลายเดือนก่อน

    Incredible tutorials. What vs code theme is that?

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

    thank you sir

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

    quick recap, nice

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

    Hope u will have a series convert HTML CSS to a Website from Dribble Design

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

      Hey Đình Khánh Lê! Thank you so much for watching, there are a few Dribbble shots from scratch that are currently in the making, so please stay tuned 🙂👍

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

      @@DevDreamer i mean , more viewer very like your series convert from Dribble , it beautiful . hope u make more video about this

  • @webb-developer
    @webb-developer 9 หลายเดือนก่อน

  • @ca-lt1fc
    @ca-lt1fc 3 ปีที่แล้ว

    last few tutorials used "let" and now it's "const"...i have a basic understanding of let vs const but do not clearly understand in what situations we use which??? Can you please clarify?

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

      let is for the variables(whose values can be changed) however, const is to declare constants(whose values can never change)