If your input was say '123', both would return the same result, i.e., 123. But if your input included other characters, e.g. '123a', this solution would return NaN and the other one 123
As far as i know, because this one is still considered as an object, where you can directly write function rather than declaring 'class' first, it is also known as Constructor Function.
good
If your input was say '123', both would return the same result, i.e., 123. But if your input included other characters, e.g. '123a', this solution would return NaN and the other one 123
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
So Javascript just wants to join in on the OOP club?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
As far as i know, because this one is still considered as an object, where you can directly write function rather than declaring 'class' first, it is also known as Constructor Function.
This comment is hidden because it contains spoiler information about the solution
wow this is pretty easy
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...