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.
@AndrewSouthpaw
I guess it would have to be changed because if there is some other column that gets added to the table, then we would have to update the query and select the newly added column as well.
If we use select ALL(select * ) we won't have to edit the query, as it selects all the columns there are to select.
You could just use products.*
very..very good, guys!
if you omit curly brackets when using arrow function you don't have to use "return" keyword
@JohanWiltink - This was only added to the kata description in response to NekoDanuki's comment
This solution is an arrow function; in an arrow function the return is implied. The syntax does not use "return". Try finding info on arrow functions.
How come you don't need to write return anywhere for this to work?
With my solution without return statements it doesnt seem to work.
Yes you are correct. If n is smaller than 0, then array[n] would return undefined and Math.pow(undefined, n) will return NaN. However, none of the test cases include negative values of n, so this will not occur.
wait, won't it return NaN if n is smaller than 0?
This comment is hidden because it contains spoiler information about the solution
Can you explain your reasoning there? Why should the query have to be edited if the table's column set changes?