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

Basic coercion of primitives

  • Jerome Covington

Jerome Covington

Aug 11, 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

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 a set
Aug 31, 2018 2 min read

Async/await using generator & Promises

An interesting tactic when researching language features is to re-create newer features, using prior, earlier supported features. For example, is it possible to approximate the features and syntax flow provided by async/await, but using only generators and Promises? -------------------------------------------------------------------------------- Baseline example in native async/await The canonical example of
Apr 15, 2018 2 min read

Building vim 8 on Ubuntu with system clipboard support

I really love doing my coding work in vim, and I also love working on Ubuntu (lately I've been on Ubuntu 17.10 and am really enjoying Gnome shell). At any rate I like to use vim 8 because it has asynchronous i/o support, which I need for ale.
Mar 17, 2018 1 min read
Jerome Covington © 2023
Powered by Ghost