Logo
    Search

    lodash

    Explore "lodash" with insightful episodes like "Hasty Treat - Handy Utility Functions with Just" and "Hasty Treat - Std Lib in JavaScript" from podcasts like ""Syntax - Tasty Web Development Treats" and "Syntax - Tasty Web Development Treats"" and more!

    Episodes (2)

    Hasty Treat - Handy Utility Functions with Just

    Hasty Treat - Handy Utility Functions with Just

    In this Hasty Treat, Scott and Wes talk about handy utility functions with Just!

    Sanity - Sponsor

    Sanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at sanity.io/create. Get an awesome supercharged free developer plan on sanity.io/syntax.

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

    03:44 - What is Just?

    06:46 - Some nice ones

    • just-safe-set → deeply setting dynamic object properties
      • set(data, 'a.long[0].path', value)
    • object-typeof
      • Why not use typeof?
        • Everything is an object
      • Why not use array.isArray?
        • Handy to have a switch statement
    • just-*-case
      • Camel, kebab, snake
    • just-compare

    10:54 - Why?

    • This is the NPM install of Stack Overflow copy+paste
    • Handy as hell
    • Battle-tested
      • Lots of ways to do simple stuff
      • Sometimes the simple stuff has weird edge cases - these are caught
    • Sometimes your checks can be messy
      • Check if an object is empty
      • 25 lines
      • Just install it

    12:05 - Other

    • Great to learn and test yourself
    • There are tests for each function
      • Run them
      • See them fail
      • Try and make it so all the tests pass without looking at the source

    Links

    Tweet us your tasty treats!

    Hasty Treat - Std Lib in JavaScript

    Hasty Treat - Std Lib in JavaScript

    In this Hasty Treat, Scott and Wes discuss the Javascript standard library proposal — what it is, how it could influence dev, and what they’d like to see.

    Sentry - Sponsor

    If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”.

    Show Notes

    1:38 - What is a Standard Lib?

    • Still experimental
    • Built-in modules don’t have to be downloaded because they ship with the browser
    • Not exposing built-in modules globally has a lot of advantages:
      • They won’t add any overhead to starting up a new JavaScript runtime context (e.g. a new tab, worker, or service worker)
      • They won’t consume any memory or CPU unless they’re actually imported
      • They don’t run the risk of naming collisions with other variables defined in your code

    6:47 - Key Value Storage is the first one:

    8:36 - What do we want to see?

    • Deep clone
      • Basically all of Lodash
    • util.isDeepScrictEqual
    • Async json.parse() / json.stringify
    • UUID
    • URL Lib for building and parsing URLs
    • Missing Array Methods
      • Most of underscore JS

    15:53 - International

    • Currency Formatting
    • Lists
    • DateTimeFormat
    • RelativeTimeFormat

    Links

    Tweet us your tasty treats!