Q10 Polyfill of String.split() | Uber Frontend Interview Question | Javscript Questions

preview_player
Показать описание
Important Playlists to crack Frontend Interviews 👇🏻

For any doubts and help follow me on:

Track: Clarx, Debris, 3rd Prototype, Castion, EMDI - Evolution (feat. Harley Bird) [NCS10 Release]
Music provided by NoCopyrightSounds.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Tags and hashtags:
#javascript #javascriptinterviewquestions #JS #js #frontend #frontendDeveloper #software #developer #engineer #softwareengineer #frontendengineer #OOPS #closures #salary #job #placement
Uber
Uber Frontend Interview question
Javascript concepts
JS OOPS
Javascript Object Oriented Programming
How OOPS works in Javascript
Prototypes in JS
Javascript __ptoto__
What is prototype in Javascript
Basics of JS
How to learn javascript
Javascript
Javascript concepts
Frontend Engineer
Frontend Developer
Software Engineer
Software Development Engineer
How to become frontend engineer
How much salary does frontend developer make
What is salary of frontend engineer
Javascript for frontend developer
Concepts of javascript
Bootcamp for frontend developers
Roadmap for frontend engineer
How to get job as frontend engineer
How to become frontend developer
Javascript tutorial
Javascript full course
Javascri[t interview questions
Javascri[t interview questions and answers
Salary of frontend developer
Рекомендации по теме
Комментарии
Автор

In this case, iterative code with just a for loop is more performant and easy to read. Your code first loops to check the index and then again loops to get a substring. Iterative one can just be done in O(n) one check. Good series keep it up!

yasharma
Автор

This code misses one edge case of the delimiter being present at the beginning of the string(or substring while recusrsive call). To handle that we need to add additional check if index i === 0.

akshay-kumar-
Автор

Thanks for the amazing solution. Can you please make videos on promise, setTimeout and setInterval polyfills?

jayantsharma
Автор

String.prototype.customSplit = function (separator) {
let startingString = this;
if === -1) return;
if (separator === '') {
return Array.from(this);
} else {
let startingIndex = 0;
let resultingArr = [];
function splitString(startingString) {
if === -1) {
return
}
const matchedIndex =
resultingArr.push(startingString.substring(startingIndex, matchedIndex));
+ separator.length));
}
splitString(startingString);
return resultingArr;
}
};

nikhilsharma