Tag Archives: Tip

Quick Tip JavaScript strings to numbers

This tip is really just different ways to convert strings to numbers. Did you know that the follow code works just fine: var string_to_number = "10" * "10"; // result 100 I thought that was cool, but funky right? Note, this does not work with the “+” operator. So a cool way to convert a [...]

Continue Reading

Quick Tip JavaScript concat operator

JavaScript has string concatting built into the langauge for example. var hello = "hel" + "lo" This is not the interesting point I wanted to talk about. It actually gets more interesting on what happens when you concat string literals with numbers. For example: var x = "33" + 3 // result "333" Notice the [...]

Continue Reading