You shouldn't need to do this.species = ..., this.legs = ... etc in the Shark, Dog and Cat Classes. By calling super the parent class (Animal) is setting these properties for you.
I want you to spend a little more time deciding on how to name things. Also your indentation/code formatting could be much better! These things are important
Anything that increments the number and checks if its a palindrom will be hopelessly inefficient for cases such as n = 9999999900000000 . Theres a O(1) solution that is clearly best.
This comment is hidden because it contains spoiler information about the solution
this works, but nicer is using ES6 default parameters https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Default_parameters
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 works, but much nicer in ES6 is to use default parameters https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Default_parameters
You shouldn't need to do this.species = ..., this.legs = ... etc in the Shark, Dog and Cat Classes. By calling super the parent class (Animal) is setting these properties for you.
Its a typo, english is not his first language. He's my student.
I want you to spend a little more time deciding on how to name things. Also your indentation/code formatting could be much better! These things are important
nice solution!
You know the last 3 lines could just be summarized into
return [res2, res1];
Also indent your code!!!!
Anything that increments the number and checks if its a palindrom will be hopelessly inefficient for cases such as n = 9999999900000000 . Theres a O(1) solution that is clearly best.
Doesn't do any palindrome checks, doesn't do any searching.