Jerome Covington
  • Home
  • Music
  • Code
  • Inspiration
  • Workflow
  • Specifications
Sign in Subscribe
javascript

Basic coercion of primitives

  • Jerome Covington

Jerome Covington

11 Aug 2017

Nothing special here, but still worth reviewing, and with a few explanations:

Number (e.g. double): +arg
Int32: ~~arg or arg|0
Uint32: arg >>> 0
String: ''+arg
Boolean: !!arg


Sources:
Trevor Norris, Introduction to the three key areas of performance

Sign up for more like this.

Enter your email
Subscribe

Take a break for a code debugging exercise in any language with a prompt for ChatGPT

Let’s play a game: I want to get better at recognizing bugs in code, and would like you to provide challenges for me to do so. When I prompt you with the words “Next exercise: <language>” please provide code in that langauge that has a bug in
15 Jul 2024 1 min read

Gists In Brief

My "In Brief" series of Gists is a collection of one-pagers for anyone who is memory-challenged or just needs a little kickstart in the morning before they've had their coffee. I hope you find the following memory aids as helpful as I do. * Exploring Sanity Schema
14 Feb 2024

The Journey is the Thing

...or, a brief introduction to machine omletting. Thinking back on when I started programming as a kid, I could pretty well sum up the playing around that I did then (and to be honest most of the work I do now) as writing a recipe. The "deliverable" was
31 Aug 2018 2 min read
Jerome Covington © 2025
Powered by Ghost