This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
What will be the output of the following code? | |
*/ | |
function foo() { | |
console.log(this); | |
} | |
const obj = { | |
foo: function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Create a function 'sum' that would make the following function call work as expected and return the sum of two numbers. | |
*/ | |
console.log(sum(2)(5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Make the function more readable and maintainable | |
Please do not comment on this public gist (comments will be removed) | |
Please do not fork on this public gist - if you got here from | |
an application form, please reply privately on the form. | |
This is used as part of a hiring pipeline, I ask you to respect that. | |
*/ | |
function doStuff(text) { | |
const lowerCased = text.toLocaleLowerCase(); |