Curated list of 10 resources to ace your next JavaScript interview
Here’s a curated list of 10 resources to ace your next JavaScript interview. For learning, javascript.info is highly recommended. If you have encountered any coding problems in the JS interview, please raise a PR to add your solution to examples/
folder. Please refer to the contributing section to learn more.
For any queries, feel free to reach out to me — topmate.io/vinitshahdeo or Twitter.
examples/
for coding problems in JSgit clone https://github.com/vinitshahdeo/inspirational-quotes.git
git checkout -b feature/<problem-name>
examples
foldercd examples
touch yourFileName.js
yourFileName.js
/**
*
* Flatten the given array
* Input: [1,2,[3,4,[5,6]],7,8,[9,10]]
* Output: [1,2,3,4,5,6,7,8,9,10]
*
*/
const flattenArray = (arr) => {
let flattenedArray = [];
arr.forEach((item) => {
if (Array.isArray(item))
flattenedArray.push(...flattenArray(item));
else
flattenedArray.push(item);
});
return flattenedArray;
};
console.log(flattenArray([1, 2, [3, 4, [5, 6, 7]], 8]));
Initially I have curated these resources for my mentees, but it’s now a community-led initiative to gather best resources to ace any JS interview. If you like it, kindly consider leaving a star or buying me a coffee! Tweet to spread a word.