JavaScript

A collection of 6 posts

Using Generator Functions as Iterators

Using Generator Functions as Iterators

If you're getting a little more advanced in your JavaScript, you may have started using the [Symbol.iterator] to make your objects iterable. Using a generator function allows for much more idiomatic looking code and saves you from having to return an object that conforms to the iterable protocol.

Make large numbers human-readable

Make large numbers human-readable

Reading a number like 1000000000000 on a line of code may be a breeze for your computer but is next to impossible for a human to do without getting a headache or nose bleed. What can we do to make large numbers more readable to the human eye?

Using Math on BigInt

Using Math on BigInt

BigInt is a relatively new addition to JavaScript and many aren't familiar with it. This was my case until recently. While working on the Closest Number puzzle on condingame.com, I found myself having to deal with numbers of sizes as big as 10^1000.

Close You've successfully subscribed to Snowfrog's blog.
Close Great! You've successfully signed up.
Close Welcome back! You've successfully signed in.
Close Success! Your account is fully activated, you now have access to all content.