JS Bitwise Operators and Binary Numbers

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2024

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

  • @RedEyedJedi
    @RedEyedJedi 5 ปีที่แล้ว +5

    You seem to be the absolute master of zero dislikes. I watch a lot of tutorials on JavaScript from all sorts of amazing people but out of all of them you definitely get the least amount of dislikes because of how clear and concise your tutorials are. Top notch job Steve, thank you so much for the work and effort you put into every one of your videos. I always let your adverts run just so you get paid.

  • @RedEyedJedi
    @RedEyedJedi 5 ปีที่แล้ว +5

    By the way the code you were looking for is (2).toString(2);

    • @adicide9070
      @adicide9070 4 ปีที่แล้ว +1

      explain, please, what wrapping the literal in parens does in terms of js syntax--

  • @rotrose7531
    @rotrose7531 4 ปีที่แล้ว +1

    I have to add that the latter part is significantly great, several years ago I tried and failed to automate background color based on some contrast on the main element. With teachings in this lecture, it seems the work can be done. Thank you.

  • @benronkin4299
    @benronkin4299 5 ปีที่แล้ว +4

    Very helpful. I finally understand JavaScript bitwise operations and their applications. Thank you!

  • @KL4NNNN
    @KL4NNNN 4 ปีที่แล้ว

    Wonderful explanation. Totally opened my mind on binary numbers which I always kept myself far away from.

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

    Once more Proessor Steve, your explanations are straight to the point and always very helpful....thanks a million

  • @rotrose7531
    @rotrose7531 4 ปีที่แล้ว

    Thank you for this nice tutorials, this opens me another door to use bizwise operator which I possibly would have never known if not for these explanations.

  • @eminqasimov3398
    @eminqasimov3398 5 ปีที่แล้ว +3

    Tricky way. I learnt from you, let log =console.log. 😄😄😄 So simple,

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

    amazing video. really really awesome! Thanks

  • @darkwarrior-3000
    @darkwarrior-3000 6 ปีที่แล้ว +1

    great video steve. wow Bitwise can be usefull :D thumbs up

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

    thank you for this video!

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

    Another very cool tutorial !!!

  • @eminqasimov3398
    @eminqasimov3398 5 ปีที่แล้ว +2

    2..toString(2) add two dots because toString assumes that it is a float number.

    • @pashabiceps95
      @pashabiceps95 4 ปีที่แล้ว

      the space will do the trick:
      2 .toString(2);

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

    Awesome tutorial, ty

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

    Just wow.

  • @aljunmontebon6062
    @aljunmontebon6062 5 ปีที่แล้ว

    @Steve Griffith
    nice video thanks, do you know how to code 2's complement in hexadecimal ? by using javascript ? Thank You

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  5 ปีที่แล้ว +2

      The two's complement is calculated by inverting the digits and adding one.
      So, to invert the bits, use the Bitwise NOT operator ~
      To add one we can use the Mathematical + operator.
      Then use the toString( ) method with the base set to 16.
      let num = 45;
      num = ~num;
      num += 1;
      let hex = num.toString(16);

    • @aljunmontebon6062
      @aljunmontebon6062 5 ปีที่แล้ว +1

      @@SteveGriffith-Prof3ssorSt3v3 thank you very much for the help dude. Hehehe