16 April 2023
Web Development Bootcamp
id 5885637075ФотографияMath.max hai usko hatado
Uski jagha if else ya fir ternary operator ka use krlo
Web Development Bootcamp
id 5885637075iski vajha se all test cases pass ho giyaHa ye log bewkuf hai
Return karne k baad humse hi function ko karwana chahte the 🥲
Web Development Bootcamp
Shubhamiska mtlb kya ye code sirf loops and end output ke basis par test hota hai ?Yes
Web Development Bootcamp
ShubhamokIsliye toh test cases chupe hue hote hain
Warna test case visible ho jayenge toh sab output pata chal jayenge
Shubhamtoa agar hum sahi se test cases and output samaj jaye toa code clear karwa sakte shayad ? 🤔
Yes lekin test cases dikhte nahi
Dikhate hi nahi ...
ReplyLekin kayi jagha par random test cases run hote hain mtlb shuffle hokar
... Toh waha agar pata chal bhi jaye toh bhi ni kuch kar sakte
toa iss mai program ka flow ke sath wo test cases kaise sync ho jate ?
ReplyYes lekin test cases dikhte nahi
Dikhate hi nahi ...
kya hum problem statement theek se read kr liye toa test case smj sakte hai ?
Web Development Bootcamp
Shubhamtoa iss mai program ka flow ke sath wo test cases kaise sync ho jate ?Bro input output hi check hota h test case me
[javascript]
function updateInfo(e) {
const info = document.getElementById("info");
const textOfCard = (i) => {
const text = [...e.target.closest("div.card").children][i].textContent;
return text;
};
const textOfInfo = (i, text) => {
[...info.children][i].children[1].textContent = text;
};
for (let i = 0; i <= 4; i++) {
let j = i + 2;
if (j >= 5) j++;
const cardText = textOfCard(j);
textOfInfo(i, cardText);
}
}
yeh function "card" ki details extract krke "info Tab" me update kr deta hai.
card ki jo details hai vo ek library named object array me bhi stored hai.
now I cant figure out ki har card ko apne movie object se kese link karu
(incredibly hard to add new features using this method)
Things i am not able to implement through this
changing the library array's objects property har jagah reflect ho jaye,
pura function html order par tika hai so there's that ;-;
i hope question dhang se smjaya hai mene lol.
here's the github repo
Web Development Bootcamp
Darshan[javascript]
function updateInfo(e) {
const info = document.getElementById("info");
const textOfCard = (i) => {
const text = [...e.target.closest("div.card").children][i].textContent;
return text;
};
const textOfInfo = (i, text) => {
[...info.children][i].children[1].textConteSpeed operator ka use kroge toh wo shallow copy banayega ...lekin agar tum sab jagha par reflect karwana chahte ho toh direct assign kro = equals to lagakar...
Darshan[javascript]
function updateInfo(e) {
const info = document.getElementById("info");
const textOfCard = (i) => {
const text = [...e.target.closest("div.card").children][i].textContent;
return text;
};
const textOfInfo = (i, text) => {
[...info.children][i].children[1].textConte
Baaki dekhta hu abhi ... Kya kiya hua hai ye ...
Darshan[javascript]
function updateInfo(e) {
const info = document.getElementById("info");
const textOfCard = (i) => {
const text = [...e.target.closest("div.card").children][i].textContent;
return text;
};
const textOfInfo = (i, text) => {
[...info.children][i].children[1].textConte
Ссылка
click to show
click to show
https://github.com/darshanCommits/Movie-Library.git
Repo dalna bhul gya
Web Development Bootcamp
Darshan[javascript]
function updateInfo(e) {
const info = document.getElementById("info");
const textOfCard = (i) => {
const text = [...e.target.closest("div.card").children][i].textContent;
return text;
};
const textOfInfo = (i, text) => {
[...info.children][i].children[1].textConteisko thoda easy banao ... complicated kiya hua hai ...
ReplySpeed operator ka use kroge toh wo shallow copy banayega ...lekin agar tum sab jagha par reflect karwana chahte ho toh direct assign kro = equals to lagakar...
Event delegation use kr rha hu to uski dikkat nahi hai
Replyisko thoda easy banao ... complicated kiya hua hai ...
Pata hai.
mujse sove hi nahi ho rha tha, ye solution bhi badi mushkil se aya 💀
Web Development Bootcamp
Darshan[javascript]
function updateInfo(e) {
const info = document.getElementById("info");
const textOfCard = (i) => {
const text = [...e.target.closest("div.card").children][i].textContent;
return text;
};
const textOfInfo = (i, text) => {
[...info.children][i].children[1].textContefunctions k andar functions ... kyu bro
DarshanPata hai.
mujse sove hi nahi ho rha tha, ye solution bhi badi mushkil se aya 💀
Фотография
click to show
click to show
ye kya hai... ek block bnaya hua hai { }
Replyye kya hai... ek block bnaya hua hai { }
looks like koi bhottt purana developer code kr rha hai isko .... 😄
Web Development Bootcamp
DarshanClean rkhne ke liye code.
Boilerplate hai isliye.Ese mat rakho clean
Itni Javascript aagyi h apko toh ab aap react sikhlo
ReplyEse mat rakho clean
Itni Javascript aagyi h apko toh ab aap react sikhlo
Abhi jo chal rha hai vo continue kr rha hu.
Web Development Bootcamp
DarshanGalat kese, kya dikkat hai isme.Apko pata h kayi log kehte Hain ki it is not good practice to do in this way
Code chal rha hota h alag tareeko se bhi
Lekin wo tareeke sahi nahi hote
Toh thoda easy banao jisse thoda easily samjh aye
Sab Functions ko alag alag rakho
Callback function banakar pass kardo
Or ese scope k sath chedkani ni karo block banakar
ReplyApko pata h kayi log kehte Hain ki it is not good practice to do in this way
Code chal rha hota h alag tareeko se bhi
Lekin wo tareeke sahi nahi hote
Toh thoda easy banao jisse thoda easily samjh aye
Sab Functions ko alag alag rakho
Callback function banakar pass kardo
Or ese scope k sath chedka
Okay.
Replymessage unavailable
abhi se aadat lg gyi toh aage dikat nhi aayegi?
Job pe toh khud krna hoga na
Web Development Bootcamp
Roseabhi se aadat lg gyi toh aage dikat nhi aayegi?
Job pe toh khud krna hoga na😂😂😂
kar diya solve much cleaner now. ab bas edit ka feature add krna hai
function getMovieObjectWithCardIndex(card) {
let index = card.dataset.index;
return library[index];
}
function updateInfo(e, card) {
const info = document.getElementById("info");
const movie = getMovieObjectWithCardIndex(card);
const textOfInfo = (i, text) => {
[...info.children][i].children[1].textContent = text;
};
for (let i = 0; i <= 4; i++) {
const cardText = Object.values(movie)[i];
textOfInfo(i, cardText);
}
}
Darshankar diya solve much cleaner now. ab bas edit ka feature add krna hai
function getMovieObjectWithCardIndex(card) {
let index = card.dataset.index;
return library[index];
}
function updateInfo(e, card) {
const info = document.getElementById("info");
const movie = getMovieObjectWithCardI
but then again isme bhi ek problem hai,
that is, library array se agar element delete karunga to index change ho jaega, thus getMovieObjectWithCardIndex function break ho jaega :/
id 1092471469Founder's office intern kya hota hey
Mtlb uss company / startup me founder ke office me intern role
Ykikykik😌Mtlb uss company / startup me founder ke office me intern role
Non tech hi hua i don't think ye useful hoga nahM