Solving Amazon's most recent Interview question Array.concat (JavaScript Custom Implementation Ep-2)

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

Amazing video Vasanth. Thank you for your superb explanation. You mastered the art of writing clean code..

saitejagatadi
Автор

You explained things very well and it was an amzing explanation from your side, thanks for explaining so well the custom implementation of array.concat method.

vinaysharma
Автор

Hi Sir, I just wanted to start by saying how much I enjoy your videos and appreciate the effort you put into creating them.
I had a doubt here in this video. It is written in documentation that this method does not change the existing arrays, but instead returns a new array but here in the myConcat function i guess you are modifying the original array. I think it would be helpful if you could check this and correct me if I am wrong here. Thank you for your time and consideration.

vishalarora
Автор

InputArray should be like this
let inputArray = [...this];
because original array cannot change. btw I learn [...array] from your interview videos, thanks.

Spider-tokf
Автор

if I used arrow function in my prototype I get this = {}, not the actual array's value. what happens here bro??

thirukumaran
Автор

This is quite Strange

Array.prototype.test = function() {
let args = arguments;
console.log(typeof args); // Output: "object"
console.log(args.length); // Output: Number of arguments passed to the function
}


arguments is an object but still has property length? Is it array-like object or something? Object Prototype does not have length property
Or As we are using it inside Array.prototype - Its giving us access to .length ? What are your views in this ?

algorithmictoolbox
visit shbcf.ru