• ###### opportunity356commented on "Multiply" javascript solution

I'm new to JS, so could you explain me, why are you using Function Expression instead of Function Declaration? Is there any profit of using it or it's just a code style?

• ###### opportunity356commented on "Convert a String to a Number!" kata

It's better to add in JavaScript tests a test with a huge number (e.g. "12345678912345"), because some solutions that use bitwise operations:

var stringToNumber = function(str){
return str|0; // or ~~str (or str^0)
}

may work incorrectlly on huge numbers.

For example:

str = "12345678912345"
str|0 // 1942903641

This happens because in JavaScript bitwise operations convert it arguments to 32-bit integers. In this example binary representation of number in str is more than 32 bit, therefore it is truncated.

• ###### opportunity356commented on "Dictionary from two lists" python solution

The error you mentioned above occures in Python3.x, while in Python2.x this code executes correctly.

The behaviour of map function is different in Python2.x and Python3.x:
"map" in Python2.x: https://docs.python.org/2/library/functions.html#map

"map" in Python3.x: https://docs.python.org/3/library/functions.html#map

Thank you for rising this question! Now I know that this code is tricky one and not compatible with version 3.x

• ###### opportunity356commented on "Convert a String to a Number!" javascript solution

This code may work incorrectlly on some inputs.
For example:

``````str = "12345678912345"
~~str // 1942903641
``````

This happens because bitwise operations convert it arguments to 32-bit integers. In this example binary representation of number in str is more than 32 bit, therefore it is truncated.

So you should use this code only, if you are sure, that all numbers that you pass in your function fit 32-bit.

• ###### opportunity356commented on "Convert a String to a Number!" javascript solution

This code may work incorrectlly on some inputs.
For example:

``````str = "12345678912345"
str|0 // 1942903641
``````

This happens because bitwise operations convert it arguments to 32-bit integers. In this example binary representation of number in str is more than 32 bit, therefore it is truncated.

So you should use this code only, if you are sure, that all numbers that you pass in your function fit 32-bit.

• ###### opportunity356resolved an issue on "Repeated Substring" kata

Thank you for your remark! I've rectified this mistake.

• ###### opportunity356commented on "Repeated Substring" kata

Thank you for your suggestions! I've edited the description and tests. Hope I've fixed all that you had mentioned before.