• ###### feitan10commented on "Ore Numbers" javascript solution

but sir he can't do it like that

• ###### lumayancommented on "4 By 4 Skyscrapers" javascript solution

I love you man

• ###### jo-on-githubcommented on "Total amount of points" javascript solution

AHH so we did not have to convert the array of strings into an array of numbers. D'oh.

• ###### madhauscommented on "Reverse Vowels In A String" javascript solution

omg, that's a massive hit.

Black magic!

• ###### Dior2004commented on "You are a Cube!" javascript solution

Pretty clever, I really like your solution because you didn't use Math operator

• ###### abhinavkhetarpalcommented on "Pillars" javascript solution

And the award for the shortest solution goes to you! :)

GG

jajaj

• ###### ivancasscommented on "Vigenère Cipher Helper" javascript solution

You would be a great politician.

Fantastic

• ###### altbrian379commented on "Total amount of points" javascript solution

For this specific instance, its completely arbitrary. Doesn't make one difference.

There is a difference if you are wondering though. In the solution, he uses a pre-increment rather than a post increment like in your question. It increments the number before the statement executes. It doesn't make a difference because the only thing in that statement is '++i'. Here's an example of it:

``````let num1 = 0;
console.log(num1++) // Outputs 0. The line executes then num1 increments after. This is called a 'post-increment'
console.log(num1) // Outputs 1.

let num2 = 0;
console.log(++num2) // Outputs 1. It increments BEFORE the line executes. This is called a 'pre-increment'
console.log(num2) // Outputs 1.

``````

FUN FACT: There is another difference but I'm not sure it applies to Javascript, but in C++ my professor once told me that, in a for-loop, pre-increments are much more efficient, and that big data companies always use pre-increments when applicable because of that. Could be the reason why its used here, I know I use it because of that fact lol.

• ###### alex-zissiscommented on "Football - Yellow and Red Cards" javascript solution

out of the box man, nice

• ###### ivancasscommented on "parseInt() reloaded" javascript solution

This is like seeing the interior of a CPU.

• ###### Jaarabitscommented on "Total amount of points" javascript solution

why is it ++i and not i++