logo
episode-header-image
About this episode

In this Hasty Treat, Scott and Wes talk about some Javascript one liners that speed up your coding experience in one line.

Sponsor - Linode

Whether you’re working on a personal project or managing enterprise infrastructure, you deserve simple, affordable, and accessible cloud computing solutions that allow you to take your project to the next level. Simplify your cloud infrastructure with Linode’s Linux virtual machines and develop, deploy, and scale your modern applications faster and easier. Get started on Linode today with a $100 in free credit for listeners of Syntax. You can find all the details at linode.com/syntax. Linode has 11 global data centers and provides 24/7/365 human support with no tiers or hand-offs regardless of your plan size. In addition to shared and dedicated compute instances, you can use your $100 in credit on S3-compatible object storage, Managed Kubernetes, and more. Visit linode.com/syntax and click on the “Create Free Account” button to get started.

Sponsor - Sentry

If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up.

Show Notes

  • 00:24:12 Welcome
  • 01:24:11 Sponsor: Linode
  • 02:11:02 Sponsor: Sentry
  • 03:54:18 Twitter ask for One Liners
  • 04:24:05 Math random const getPsuedoID =() => Math.floor(Math.random() * 1e15);
  • 05:43:09 Random color
  • Paul Irish random color '#'+Math.floor(Math.random()*16777215).toString(16);
  • 06:41:06 Console.log as an object. console.log({ dog, person }); VS Marketplace Link
  • 08:29:17 Edit anything document.designMode = "on"
  • 10:15:15 Temporal date export const today = Temporal.Now.plainDateISO();
  • 11:44:05 Console(log) const myFunc = (age) ⇒ console.log(age) || updateAge()
  • 13:26:13 Remove a prop const { propToRemove, ...rest } = obj;
  • 15:29:01 PHP style debugging preElement.innerText ={JSON.stringify(val, '', ' ')}`
  • 16:31:00 First and Last Destructure var {0: first, length, [length - 1]: last} = [1,2,3];
  • 17:34:17 Speed up audio video document.querySelector('audio, video’).playbackRate = 2
  • Overcast
  • 19:44:15 Sleep function let sleep = (time = 0) => new Promise(r => setTimeout(r, time))
  • 20:26:00 If statements on one line If (!thing) return 'something'

Tweet us your tasty treats

Up next
Yesterday
931: Project Init - How to Make Good Choices When Starting a New Coding Project
Scott and Wes dive into the fundamentals of project initialization and planning, from outlining ideas and choosing the right tools to making smart technology decisions. They also chat about leveraging AI and collaboration to shape better projects before rolling up your sleeves an ... Show More
30m 46s
Aug 20
930: Text Editor Keybindings, WASM Replacing Docker, LLM apathy and hosting mini apps
In this potluck episode of Syntax, Wes and Scott answer your questions about VS Code vs Cursor, navigating promotions and job titles, database fundamentals, avoiding decision paralysis, how AI is shaping frameworks, and more! Show Notes 00:00 Welcome to Syntax! 00:56 Brought to y ... Show More
55m 37s
Aug 18
929: Cloudflare Blocks AI Crawlers × Debugging Local Data × Raising Kids with Healthy Digital Habits and More
Scott and Wes tackle listener questions on everything from local-first databases and AI-built CRMs to protecting APIs and raising kids with healthy digital habits. They also weigh in on Cloudflare’s AI crawler ban, portfolio critiques, and more hot takes from the dev world. Show ... Show More
53m 58s
Recommended Episodes
Apr 2018
The state of Node security (JS Party #23)
Suz Hinton, Christopher Hiller, and Jerod Santo talk with Adam Baldwin about his company being acquired by NPM, the security of Node, best practices, and more. Discuss on Changelog News Changelog++ members support our work, get closer to the metal, and make the ads disappear. Joi ... Show More
54m 51s
Dec 2022
Big news in Deno Land
Deno creator Ryan Dahl goes one-on-one with Jerod to discuss their new npm support, why he’s so excited about JavaScript containers, Deno Deploy’s present & future, what he thinks about alternative runtimes like Bun, WinterCG, how Wasm fits into the story & more! Discuss on Chang ... Show More
54m 38s
Jun 2022
Ahoy hoy, JSNation & React Summit!
Nick went to Amsterdam for JSNation & React Summit 2022 and he joins Jerod to report on all the goodness! He also sits down with two special guests involved with the confs to talk Jest Preview and GraphQL Cache Discuss on Changelog News Changelog++ members save 4 minutes on this ... Show More
1h 11m
Apr 2022
Postgres.js (JS Party #221)
Rasmus Porsager created Postgres.js –the fastest full-featured PostgreSQL client for Node.js and Deno. Today he joins Jerod for a deep-dive on Postgres, why he created this open source library, and how you can use it to build pg-backed JavaScript applications. Discuss on Changelo ... Show More
50m 6s
Apr 2022
Postgres.js
Rasmus Porsager created Postgres.js –the fastest full-featured PostgreSQL client for Node.js and Deno. Today he joins Jerod for a deep-dive on Postgres, why he created this open source library, and how you can use it to build pg-backed JavaScript applications. Discuss on Changelo ... Show More
50m 6s
Jun 2022
ESLint and TypeScript
Josh Goldberg joins Nick, Chris & a very nasally-sounding KBall for a fun conversation around TypeScript ESLint. They discuss why we need ESLint when we have TypeScript, some useful rules in typescript-eslint, how it works, and a few hot takes along the way! Discuss on Changelog ... Show More
1h 3m
Feb 2024
Angular moves fast without breaking things
KBall & Amal dive deep with the “Dazzle of Zebras” (possible future band name), Angular team members Jessica Janiuk & Mark “Techson” Thompson. Along with an absolute riot of puns, they cover topics such as Angular’s new deferrable views feature, how the Angular core team handles ... Show More
1h 11m
Aug 2022
Qwik is a new kind of web framework
AngularJS creator Miško Hevery has a new web framework he wants to tell us about, but he’s not pitching just another framework, but with different DX. He says that Qwik is a fundamental rethinking of how a web application should work. And he’s here to convince Jerod & KBall that ... Show More
1h 2m
Mar 2024
13% of the time, Devin works every time (JS Party #317)
Jerod, KBall & Nick discuss the latest news: Devin, Astro DB, The JavaScript Registry, Tailwind 4 & Angular merging with Wiz. Oh, and a surprise mini-game of HeadLIES! Leave us a comment Changelog++ members save 5 minutes on this episode because they made the ads disappear. Join ... Show More
1h 6m
Feb 2024
Angular Signals
KBall & Amal interview Alex & Pavel from the Angular Signals team. They cover the history, how the Angular team decided to move to signals, what the new mental model looks like, migration path & even dive into community integrations and future roadmap. Leave us a comment Changelo ... Show More
1h 6m