Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Indeed. Instead of
if( x === o ) { return true; } else { return false; }
just doreturn x === o
.Remove equal check from loop condition
i <= str.length
; That it'sNo need of adding else if statement is true then we are done if not true the simply return false;
No need of adding else if statement is true then we are done if not true the simply return false;
Instead of using two if statements you should use switch or if...else...if construct, these will work faster. let shppose if value if x then 2nd if statement will also execute but not in switch and if...else...if construct.