Online Technical Mock Interview of one of my viewers. Where I ask JavaScript Fundamental Questions and give their answers.
If you like to be mock interviewed, email me at
* info@interviewnest.com
Please be my patreons on patreaon
* https://www.patreon.com/techsith
Follow me for technology updates
* https://facebook.com/techsith
* https://twitter.com/techsith1
Help me translate this video.
*
Note: use https://translate.google.com/ to translate this video to your language. Let me know once you do that so i can give you credit. Thank you in advance.
Original source
50 responses to “JavaScript Mock Interview | Online Interview Questions and Answers”
var test = {
a: {
b: {
c: "one"
}
}
}
var test2 = {…test.a.b}
test2.c = "two"
sir, is this correct
const str = arr => arr.join(' , ')
This was actually super useful. Thank you.
I always enjoy your videos. Very useful. Thankyou so much
All he needs to learn is how these javascript methods he memorized works at the lower level.
u are super
c=[…a,…b].sort( (x, y) => x – y )
c=[…a,…b]
function print(arr){return console.log(arr.toString())}
how come the solutions to newB.getX() question gives me this error only ; I tried it in JSRun software and JSbin.com and browser console as well but it gave different errors like something is missing and wasn't giving the expected output
that's great.
Hey… Could u plz create a video on angular mock interview
Something tells me the guy isn't a beginner. He is doing JS years!!!
I have learned a lot by all your JS videos. Keep it up. Really great job Sir…Thanks Sir.
love these. I had a technical phone screening and i bombed so hard. Now I have better idea what to expect thanks.
thank you so much for these sessions sir. I suck at JS interviews and I find this really helpful.
awesome video, thx!!!!!!
666th liked this video. Thank you.
My day ends with your video. Thank you so much sir for this wonderful experience
good one
Great initiative for JS learners and who are seeking JS jobs. Keep it up. All the best.
Please try to capture clear sound of the interviewee.
36.50 i was saying in mind that it would return undefined.
const obj = {
x:1,
getX() {
const inner = function () {
console.log(this.x)
}.bind(this)
inner();
}
}
obj.getX()
the last question wasn't asked right
the code will give "1" as he said
but this code will give undefined
const obj = {
x:1,
getX(){
const inner = function(){
console.log(this.x)
}
inner();
}
}
obj.getX();
so there are four solutions you can do
1- the code you have posted
2- assign this to new variable before inner funtcion
3- use inner.call(this)
4-use inner.bind(this)
greatings ๐ ๐
Thanks for the video. It was very helpful.
29:28 the answer is wrong by using a>b in sort method its output is : [1, 2, 5, 7, 9, 2, 5, 7, 12, 100] and its not sorted properly , instead we should put a-b to have : [1, 2, 2, 5, 5, 7, 7, 9, 12, 100]. Thanks guys
Answer for the question at 23:46 const obj={
a:{
b:{
c:1
}
}
}
var clonedObj=(JSON.parse(JSON.stringify(obj)))
clonedObj.a.b.c=2;
console.log(obj);
console.log(clonedObj);
Answer for the question in the video at 17:09 const a= function(x){
this.x=x;
this.getX=function(){
return this.x;
}
}
const b=function(x, y){
a.call(this,x);
this.y=y;
this.getY=function(){
return this.y;
}
}
b.prototype=a.prototype;
b.prototype.constructor=b.prototype.constructor;
const newB = new b('x', 'y');
console.log(newB.getX());
console.log(newB.getY());
On the array merge and sort, doesn't the 2N solution assume that array B is already sorted which is not stated as a condition? Or is it, if one asks for such clarification?
About the solution given by this guy(One who is giving Interview) at 14:28 for [1,2].print() since i am new to ES6 so i tried his solution on browser but i am getting error at for..of "Uncaught TypeError: this is not iterable" how to access the arguments inside print function. By arguments i mean when i call print like you have called.
Seeing this video makes me feel like I have to go over all the javascript videos again ps I always watch every ad on your videos. Great as usual
26:44, whats the difference between const clone = obj and const clone = JSON.parse(JSON.stringify(obj))?
Array.prototype.print = function(){ return this.join(', ')}
I didn't get that alternative concept to sort . Can someone help me out ?
Soo good. Would of missed most myself **cry-face
He does not pass your level 7. Because arrow function doesn't have his own this, so it's not gonna work ๐
27:10 I came up with this solution const c = […a, …b].sort();
Simplest and cleanest solution at 27:00 is this:
const a = [1,2,5,7,9];
const b = [2,5,7,12,100];
const c = a.concat(b);
let x = c.sort(function(a,b){return a-b});
console.log(x)
14:35 Why does he use i === this.length ? is this only to make sure that if the element exit in the array then return the element itself? I'm little bit confused about the if statement here
14:55 'this' won't work here if it's an arrow function. all u get is undefined.
Thank you
For the array print question:
Array.prototype.print = function()
{
console.log(this.join(","));
}
var arr = [1,2,4,5];
arr.print()
My ridiculous answer on the 3rd test:
getA: function() {
console.log(this.a);
return {
getB: function() {
console.log(this.b)
}.bind(this)
}
}
Hi bro , I got offer letter from CTS yesterday, joining date as Oct 8 2018. I start to watch ur video tutorial last two days before interview. Really it helpful… Same questions I got in interview, thank you bro
That was awesome!
3:58 shouldn't it be pushing x[i] instead of just i? Just pushing i would push the key, not the value, resulting in a and b instead of 1 and 2
I can just say wow
for asc sort() array you need “`a.concat(b).sort( (a,b) => a – b )“`
every question is unic n creative way of explaination. we never ever seen this kind of heavy stuff in javascript
TnQ very for creating a great session on javascript