Basic JavaScript this time in the fourteenth question of the quiz for a full-stack developer. Do you like IT puzzles?
Write strangeConcatenation function in basic Java Script so the following line of code
console.log(strangeConcatenation('what ')('is this?'));
results in what is this? output.
For one of the correct answers scroll down
.
.
.
.
.
.
The function can be written like that:
function strangeConcatenation(text1) { return function(text2) { return text1 + text2; } }
It is one of possible answers. Check yours by running it in a browser.