Skip to content

Instantly share code, notes, and snippets.

@samueljoli
Created January 30, 2017 17:53
Show Gist options
  • Save samueljoli/c6be964418c06c74399993683d5e964f to your computer and use it in GitHub Desktop.
Save samueljoli/c6be964418c06c74399993683d5e964f to your computer and use it in GitHub Desktop.
Assembler tricks just for kicks
//javascript
if (matches = line.matches(/qty: (\d+)/))
this.quantity = matches[1];
else if (matches = line.matches(/size: (\d+)x(\d)/)
this.width = matches[1];
this.height = matches[2];
else if ... and so-on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment