11:40 When we access a variable or function before its declaration it is called hoisting and thus we'll see error, and also hoisting acts different for ( Let and Const ) Declaratives for example DTZ ( Dead Temporal Zone ).
Actually, reversing an array means overwriting the original array with its elements in reverse order, not just printing the elements in reverse on the console(i.e. traversing array from end), which is not acceptable even for freshers nowdays. I think you should have told about this in the video.
let arr=[1,2,3,4]; let rev=[ ]; for (let num in arr){ rev.unshift(num); } console.log(rev) Can we use this in the interview or the interviewer will just go deep in these concepts????
30:24 bhai.. ishne sirf array ko reverse print kiya hai..😂 Array reverse nahi hua.. array ko last index se print karne se array reverse ho nahi jata...😅😅... Learning = kabhi kabhi interview lene vale ko sab kuchha aata ho aesa jaruri nahi hai.. they also dont find the mistakes or error.. so jo aata hai vo bol dalo.. LinkList reverse karne ko bole and nahi aata toh Linklist ki tail se print karva do .. chal jayega 😂🤣🤣
Yo don't need to convert object to key values its unnecessary and taking memory object keys can be directly iteratable throw for (const key in obj){ Const value = obj[key] } Loop
11:40 When we access a variable or function before its declaration it is called hoisting and thus we'll see error, and also hoisting acts different for ( Let and Const ) Declaratives for example DTZ ( Dead Temporal Zone ).
woahh! very nice
My solution for reversing the array question
const arr=[1,2,3,4,5,6,7,7]
function reverse(arr){
let start=0
let end=arr.length-1
while(start
Nice! Latest wale mock interview ka bhi solve krke dekho
@@SemicolonGuy ok try karte hu aaj hi 👍 by the love your content ❤️
17:55 Need to use === to compare datatypes too . Javascript for ya
Actually, reversing an array means overwriting the original array with its elements in reverse order, not just printing the elements in reverse on the console(i.e. traversing array from end), which is not acceptable even for freshers nowdays. I think you should have told about this in the video.
thanks for pointing this out. Well said!
let arr=[1,2,3,4];
let rev=[ ];
for (let num in arr){
rev.unshift(num);
}
console.log(rev)
Can we use this in the interview or the interviewer will just go deep in these concepts????
i wouldn't suggest using inbuilt functions for solving problems.
You can't showcase your Problem solving skills with bunch of inbuilt functions.
Please try to zoom in the screen sometimes code is not visible or blurry
I would Just have used Bubble sort to reverse the array
Simply use for loop and starts with length-1 and decrement - -
for problem 1 can't we just stringify and replace it then parse it again?
it is not a better approach
30:24 bhai.. ishne sirf array ko reverse print kiya hai..😂 Array reverse nahi hua.. array ko last index se print karne se array reverse ho nahi jata...😅😅... Learning = kabhi kabhi interview lene vale ko sab kuchha aata ho aesa jaruri nahi hai.. they also dont find the mistakes or error.. so jo aata hai vo bol dalo.. LinkList reverse karne ko bole and nahi aata toh Linklist ki tail se print karva do .. chal jayega 😂🤣🤣
Nhi bhai esa nhi hai. Mujhe sirf approach dekhni thi Isliye aage continue krdia.
Hmesha solution nhi dekha jaata hai
bhai linkedList ki valuues ko kese print krega tail se, usme backward pointers nahi hote uske liye doubly linked list chaiye hogi
function flattenObject(KeyValues, parentKey = "", result = {}) {
for (let [key, value] of KeyValues) {
let newParentKey = !!parentKey ? `${parentKey}_${key}` : key;
if (typeof value === "object" && value !== null) {
flattenObject(Object.entries(value), newParentKey, result);
} else {
result[newParentKey] = value;
}
}
return result;
}
let obj = {
a: 1,
b: {
c: 2,
},
c: {
d: {
e: {
f: 3,
},
},
},
};
let output = flattenObject(Object.entries(obj));
Object.entries function ke andar hona chhaiye
Yo don't need to convert object to key values its unnecessary and taking memory object keys can be directly iteratable throw
for (const key in obj){
Const value = obj[key]
} Loop
Sir you look like purav jha 🗿
who is that?
@@SemicolonGuyHe's AI😅
Mera bhi loo Bhai interview
form bhar do bhai
Mock form is no longer accept response 😞
eaa mugi tero interview gedaa jastho lagxa !