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.
The word will be different each time due to testcases and will also include random words (randomisation) to prevent cheating. The word will be named
s
which is the parameter of the function.As shown in the image above, you can print the input
s
to the console to see what it is if you want, but your code should work on every single word, not just one specific one. Therefore it is not necessary to see what the parameters
is.console.log(s)
is responsible for the log result in the left andreturn s
is responsible for returning the final value shown by "Expected: 'es', instead got: 'test'".The example testcases show you what the parameter
s
is, and what the expected result is.To further what Voile has said,
s
is the variable that stores the word that you are sent. So if you get sent the wordHello
,s
would be equal toHello
. So if I decided to go:The output would be:
As Voile has said, you may want to take a look at variables and functions in general to get a better understanding of writing code.
s
is the input argument storing the word.I suggest you to take a look what are
variables
,function arguments
andfunction parameters
:)It is sent to the method/function that you write. In javascript the function looks like this:
s
is the word you are being given. If you have any other questions, let me know.