10 JavaScript Features You Need To Use

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024
  • Please note, this is satire. If you want real JavaScript tips then check out someone like ‪@Fireship‬.
    I hope you enjoyed :D
    If you want to see more consider subscribing.
  • РазвлеченияРазвлечения

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

  • @SimGunther
    @SimGunther 4 месяца назад +60

    Javascript: the only language outside of INTERCAL that does whatever it feels like no matter what you typed.

  • @no_name4796
    @no_name4796 4 месяца назад +72

    How to unoptimize you js code:
    1) you can't
    10) javascript is already pure garbage
    2) this
    3) sequence
    4) was
    5) ordered
    6) by
    7) javascript
    8) (lol, string orders, instead of int order
    9) goes brrrrr)

    • @rt9i593
      @rt9i593 4 месяца назад

    • @jerichaux9219
      @jerichaux9219 4 месяца назад +2

      const COLLATOR = new Intl.Collator(‘en’, { numeric: true, sensitivity: ‘base’ });
      arr.sort((a, b) => COLLATOR.compare(a, b));
      Enjoy.

    • @rt9i593
      @rt9i593 4 месяца назад

      @@jerichaux9219 thats a nightmare

    • @itsentdev
      @itsentdev 4 месяца назад

      @@jerichaux9219
      let mut a = [3, 10, 17, 0, 1, 5];
      a.sort_unstable();
      wow, isn't using an actually not retarded language pleasant

    • @itsentdev
      @itsentdev 4 месяца назад

      @@jerichaux9219 ...or
      let a = [17, 55, 19, 22, 10, 11, 1];
      a.sort_unstable();

  • @hoodiegal
    @hoodiegal 4 месяца назад +35

    When I was in my teens, I wanted to work with programming. Then I learned about Javascript.

    • @546pvp
      @546pvp 4 месяца назад

      Then yo uare lucky you haven't learned about c++. Thats a real life changer. Made me question my career.

  • @TragicGFuel
    @TragicGFuel 4 месяца назад +12

    Just changed all my variables to racial slurs, my job has never been more secure!
    Thank you! 🙏

  • @alex65432
    @alex65432 4 месяца назад +16

    Js is really crazy.often you can cause an infinite loop on the server by simply replacing a array in a json with object with a length prop.
    {length:"Infinity"}
    And of course it converts the string to Infinity.

    • @Sirfreelancealot
      @Sirfreelancealot  4 месяца назад +5

      Now I have to test this

    • @alex65432
      @alex65432 4 месяца назад

      @@Sirfreelancealot yeah js converts "Infinity" in Infinity when comparing it with a number
      console.log(100

    • @alex65432
      @alex65432 4 месяца назад

      @@Sirfreelancealot it works if the server uses a simple for loop to iterate over the string
      const str= {length:"Infinity}
      for(let i=0;i

    • @twothreeoneoneseventwoonefour5
      @twothreeoneoneseventwoonefour5 4 месяца назад

      """often"""
      Dude you literally made it purposefully like that. It never happens and quite literally will never happen in reality.

    • @alex65432
      @alex65432 4 месяца назад

      ​@@twothreeoneoneseventwoonefour5 you dont know how many devs just iterate over not sanitised input.in one case i replaced a array with this object and it lagged the server (of a friend) because the server was stuck in a for loop periodically awaiting fetch() requests.Remember you just need to find one api that is vulnerable.

  • @davr1
    @davr1 4 месяца назад +19

    My favorite fact about JS is that there is a legacy DOM object that's specifically made falsy, for some ungodly reason. There are no other objects like this.
    typeof document.all === "undefined" is true, but document.all !== undefined is also true

    • @widmo206
      @widmo206 4 месяца назад +1

      What about document.all !=== undefined ?

    • @xelspeth
      @xelspeth 4 месяца назад

      @@widmo206 Uncaught SyntaxError: Unexpected token '='

  • @424ever
    @424ever 4 месяца назад +6

    5:31 If you think E-Mail validation is that simple, might I recommend Dylan Beattie's talk "Email vs Capilalism, or, Why We Can't Have Nice Things"

  • @MizManFryingP
    @MizManFryingP 4 месяца назад +4

    Loved the eval() bit haha

  • @FrontendNerd-lg3oh
    @FrontendNerd-lg3oh 4 месяца назад +3

    this guy has TALENT

  • @pokefreak2112
    @pokefreak2112 4 месяца назад +6

    The funniest (un)optimization is reccomending people to use axios for json parsing

    • @Sirfreelancealot
      @Sirfreelancealot  4 месяца назад

      Wait what's wrong with axios?
      Better than raw dogging fetch at least

    • @pokefreak2112
      @pokefreak2112 4 месяца назад

      @@Sirfreelancealot Axios solved the problem of XMLHttpRequest having an ugly API and not being promise-based.
      With fetch being standard and well supported there's no real reason to use axios anymore.
      You're adding kilobytes to your bundle just to have a marginally cleaner, non-standard API during development.
      It's like people still pulling in jQuery because they prefer $ over querySelector

    • @Sirfreelancealot
      @Sirfreelancealot  4 месяца назад +1

      Fair enough. It's what I've been using for years and never realized people switched.
      Good to know :)

    • @KirkWaiblinger
      @KirkWaiblinger 4 месяца назад

      Axios 1.0 still doesn't have a migration guide.

    • @acopier
      @acopier 4 месяца назад

      @@Sirfreelancealot axios is pure shit, fetch is much better

  • @dude2542
    @dude2542 3 месяца назад

    HUNGARY MENTIONED!

  • @toby_cm
    @toby_cm 4 месяца назад +2

    npm package is real now

  • @boltyk1
    @boltyk1 4 месяца назад +16

    how can you be unemployed with all this knowledge?

    • @Sirfreelancealot
      @Sirfreelancealot  4 месяца назад +24

      I quit to pursue my lifelong passion.
      Writing code and not getting paid for it.

    • @boltyk1
      @boltyk1 4 месяца назад

      @@Sirfreelancealot how can you quit if it's a lifelong?

    • @ME0WMERE
      @ME0WMERE 4 месяца назад

      no no, he's unemployed _because_ of all this knowledge

    • @hashtag9990
      @hashtag9990 4 месяца назад

      ​@@boltyk1He quit his job to pursue his lifelong passion

  • @RainOrigami
    @RainOrigami 4 месяца назад +1

    the actual regex for email address verification is much, much worse.

  • @HumblestBumble
    @HumblestBumble 4 месяца назад

    can confirm

  • @lagy_o
    @lagy_o 4 месяца назад

    Ez meglepett :O

  • @wentallout
    @wentallout 4 месяца назад +1

    you're telling me this whole video is a lie?

  • @Drukarka4D
    @Drukarka4D 4 месяца назад

    xD

  • @EdwinMartin
    @EdwinMartin 4 месяца назад +1

    Pretty interesting that people would rather shit on javascript instead of learning it

    • @Sirfreelancealot
      @Sirfreelancealot  4 месяца назад +5

      I use it professionally, shitting on it is just a coping mechanism at this point.

    • @itsentdev
      @itsentdev 4 месяца назад +1

      pretty interesting how most javascript devs would rather sit in an increasingly broken flaming mess than do something about it / switch languages

    • @EdwinMartin
      @EdwinMartin 4 месяца назад

      @@itsentdev keep telling yourself that

    • @itsentdev
      @itsentdev 4 месяца назад

      @@EdwinMartin i'm not 'telling myself' that. did leftpad teach you anything about npm?
      well, ignoring npm, javascript itself.
      // interesting decision to make null equal zero like C...
      if (0 >= null && 0

  • @Salamander002
    @Salamander002 4 месяца назад

    first

  • @justrabbit
    @justrabbit 4 месяца назад

    second

  • @Jonas-Seiler
    @Jonas-Seiler 4 месяца назад

    the language itself is not even the problem, in fact it’s pretty great, however then there’s the web as a platform and the node ecosystem, so I guess it does in fact suck horribly after all, don’t ever use it if you value your sanity, especially don’t get a job in webdev (for all our sakes)

    • @itsentdev
      @itsentdev 4 месяца назад

      the language itself is a part of the problem