Harry Bhai, Mai ek baat puchna chahta hu, 3rd Ques mai agar hum "Try Again" i=prompt(Enter a number) ke baad lagate hai toh correct number entered krne ke baad bhi ek baar print ho jayega and agar hun "Try Again" i=prompt(Enter a number) ke pehle likhte hai toh pehli baar puchne se pehle hi ek baar "Try Again) Print ho jayega. Toh is problem ko kaise solve kiya jaye. Thanks for this Wonderful Course.
@amirmunir7414 Жыл бұрын
@@rajatgarg135 Correct now what we shall do?
@rajatgarg135 Жыл бұрын
@@amirmunir7414 need to write proper code with logic. Working on it
@amirmunir7414 Жыл бұрын
@@rajatgarg135 Let's see
@pmahaur9627 ай бұрын
loop mein let samajh nhi aya
@hokorashi_6283 Жыл бұрын
I am a bit late here, just wanted to say ur tutorials are awesome thanks for helping me follow my passion. Also wanted to add a bit that in the problem no.3 u can see that everytime u execute it says try again first than asks user for a number. U can over come that by nesting an if else statement in while loop. i tried it and works like a charm. Here is the code : let n = 4 let a while(a != n) { a = prompt("Enter a number") if(a == n) { console.log("You wrote correct number") } else { console.log("Try again") } }
@Netpilation Жыл бұрын
let correctNumber = 122 while(true){ let typeNumber = parseInt(prompt("enter the numebr::")) if (typeNumber===correctNumber) { console.log("you entered the correct number>>") break } else{ console.log("the number you entered is incorrect") } } i did it this way and it is way more optimized than yours
@muhammadnomanaslam184 Жыл бұрын
thank u brother ;)
@cart0_0n24 Жыл бұрын
@@Netpilation but if the no. is incorrect USER is not allowed to enter the correct no. again ... and in the question it is mentioned that ... print untill the user enters the correct no.
@cart0_0n24 Жыл бұрын
just use ... alert("try again") instead of console.log("try again")
@asvadsagheer8351 Жыл бұрын
//Problem 3 let text = prompt("Enter correct number") for(let i = 0; i !== "43"; i++){if (text === "43") { alert("Perfect") break; } else{ text = prompt("Enter correct number") } }
@Yenoke2 жыл бұрын
9:16 you can do it like this => let cn = 4 let i; while(i!=cn){ i = prompt("Enter a number") if(i==cn) { console.log("You have entered the correct number") } else { console.log("Try again") } }
@arabindrajak49512 жыл бұрын
bhai initialy i mai to kuch value nhi rh rha ha phir bhi loop mai kaise enter kar ja rha ha 0 ke wajah se kya?
@Yenoke2 жыл бұрын
@@arabindrajak4951 Until and unless you will enter the value of 'cn' it will be looped.. Like here it is 4 so you need to enter 4 in the console to stop the loop
@rayyanbhattibhatti77722 жыл бұрын
thanks bro this syntax helped me a lot with my assignment
@rayyanbhattibhatti77722 жыл бұрын
let guess; let number = 200; while(number!=guess){ guess = prompt("Guess the number between 1 and 1000"); console.log(typeof guess); guess = parseFloat(guess); console.log(typeof guess); console.log(guess); if(number == guess) { alert('Your guess is right!'); } else if(number > guess){ console.log("too low"); } else { console.log("too high"); } }
@Yenoke2 жыл бұрын
@@rayyanbhattibhatti7772If I am not wrong, ths number is fixed, 200 you could have also done let number = Math.random() Or let number = Math.floor(Math.random() One of these two will work I don't remember So it chooses a random number so the guessing number is not same Correct me if I am wrong
@manvanthmn83902 жыл бұрын
The video's intro and outro was very good . the video quality is also good , the concepts are best . in all round case . I will rate this course a console.log( '5/5' )
@clubsign362 жыл бұрын
Simplest methd for Q1 let obj = { harry : 98, rohan : 90, vishal : 22, rahul : 78 } for(names in obj){ console.log("Marks of "+names+" are "+obj[names]) }
@MSajjad92 жыл бұрын
Harry Bhai the best teaching.. learning Javascript with is really amazing... Enjoying this series
@learner801 Жыл бұрын
Very amazing tutorials! I'm enjoying learning with you as always! We're lucky to have Harry in the world of programming who provides top notch quality content for free ❤
@sandeepsolanki1932 жыл бұрын
Code with harry is helping many peoples in free . It is really amazing ....
@wonderfullife5665 Жыл бұрын
To remove the try again during the start in problem 3, it's better to use if else. Like this let cn ="Harry Bhai"; let i while(cn != i){ i =prompt("Who is the Best KZbinr") if(i !=cn){ console.log("Galat Zabab, Try again") } else{ console.log("Correct Answer") } }
@deeprajg1 Жыл бұрын
that's what I was looking for, thanks a lot!
@MohammedHusainmobikira2 жыл бұрын
Harry Bhai love from whole world God Bless You chote bhaiyo ki Dua hai apke sath 🤲🤲🤲 @CodeWithHarry Harry Bhai videos please jaldi jaldi upload karo kyuki ek leh banne k baad ruka nahi jata fir leh toot jati hai. and roz repeated videos dekhna pdta hai. na chahke bhi revision krna padta hai 😂🤣🤣
@abdulquadir3611 Жыл бұрын
Excellent questions, Harry bhai. Level badha diya aapne... I solved #3 like this: const cn = 4; while (parseInt(prompt("Input the correct number: ")) != cn) { console.log("Try again!"); } console.log("You entered the correct number.");
@Junaid_Az1z8 ай бұрын
Harry bhi I'm watching you when your subscribers was 1M you are a great person. Bhot mza aata ha ap ke videos ma bhot kuch learn karny ko milta ha
@AkashGupta-kw8hl2 жыл бұрын
Harry bhai thankyou so much aapke jese helpful person bhut kam hai jo free m sara course provide krate hai Harry bhai angular ki video series bhi bnay plz 🙏🙏🙏
@muhammadabubakar19902 жыл бұрын
harry bhai ap buht acha kaam kar rahy hu may pakistan sy ap ki videos dekh kar buht kuch sekha may phly may ny web design with html us ky badd wordpress ab java aur is k baad python bhi sekho ga mery pass fee ni thi in courses ki ap ki wajah sy sb mumkin howa hai love you bhai from pakistan 🚩
@sagarpanwar28452 жыл бұрын
Maza aagya harry bhai bas aise hi knowledge baante rho.
@Abhilash_Nanda2 жыл бұрын
A different approach to get average for any number of arguments: function multiple(...arguments){ let a=arguments; let b=a.length; let sum=0; for(let i=0;i
@vickys40 Жыл бұрын
All Programs, Thank You Harry Bhai ❤❤❤ // Practice Question 1 & 2- write a program to print the marks of a student in an object using for loop // Using for..in loop let marks_1 = { Harry:98, Rohan:70, Aakash: 7 } for (const x in marks_1) { console.log(`The Marks scored by the student ${x} is : ${marks_1[x]}` ); } // Using for loop - CWH Lec let marks_2 = { Harry:98, Rohan:70, Aakash: 7 } for (let i = 0; i < Object.keys(marks_2).length; i++) { console.log(`The Marks of ${Object.keys(marks_2)[i]} is ${Object.values(marks_2)[i]}`); // Object.keys(marks_2) // Returns an Array with the keys as value // Object.keys(marks_2).length // Returns the length of the Array (4) // Object.values(marks_2) // Returns an Array with the values as value // marks_2(Object.keys(marks_2)[i]) // Returns the corresponding value of the key in the object (Alternate method to print values) } // Practice Question 3 - write a program that prints "Try again" until user enters the correct number const prompt = require("prompt-sync")({sigint: true}); let CorrectNumber = 5; let i; while(i != CorrectNumber){ i = prompt("Enter a Number "); console.log("Try Again"); // flaw - Prints "Try again" even when entered the CorrectNumber } console.log("You have entered the correct number"); // Practice Question 4 - write a function to find the mean of 5 numbers let a = prompt("Enter any Number "); a = Number.parseInt(a); let b = prompt("Enter any Number "); b = Number.parseInt(b); let c = prompt("Enter any Number "); c = Number.parseInt(c); let d = prompt("Enter any Number "); d = Number.parseInt(d); let e = prompt("Enter any Number "); e = Number.parseInt(e); function MeanNumberFinder(a, b, c, d, e){ return (a + b + c + d + e) / 5; } console.log(MeanNumberFinder(a, b, c, d, e));
@aidynonwzm Жыл бұрын
There is one Logical error in Problem No # 3 and it can be done like this let cNumber while(cNumber != 4) { cNumber = prompt("Enter number : ") if(cNumber != 4) { console.log("Try Again") } } console.log("Congratulation! Your number is in the lucky draw")
@mr.innovation2693 Жыл бұрын
@@aidynonwzm naliko dekho itna simple hai ye let students={ enna:20, minna:25, dicca:56, sicca:56, } for(key in students){ console.log(`${key} got => ${students[key]} marks`) } let a= typeof(students); console.log(a)
@findsyed Жыл бұрын
Hi Harry, Syed here from Indonesia it's amazing Thanks for sharing javascript course. let cn = 4 let i while(i !=cn){i=prompt("kindly enter the correct number") if (i !=cn ){alert(" you entered wrong number")} } console.log("You enter the correct number")
@undefined51312 жыл бұрын
//Q3.print "try again " until user caters the correct number console.log("you are having 5 chances to choose correct value") let n=4; for(i=0;i
@taniyaverma433 ай бұрын
1:22 Very amazing tutorials! I'm enjoying learning with you as always!
@adnanismail426 Жыл бұрын
Codewithharry is the most relevant channel on youtube keep up the good work
@beatkinganu2807 Жыл бұрын
fabulous explanation harry bhiya
@purnimavats01 Жыл бұрын
In problem 3, we have to convert our input data type into int bcoz it takes input as a string, which maybe results in an error(in VS code). It happened to me 😅. I used the following code to resolve it. Hope it will help someone else too let cn = 4; let i; while (i != n){ i = parseInt(prompt("Enter a number:") } console.log("You have entered the correct number") Thank you so much bro for these tutorials ❤❤
@ramphapal6610 Жыл бұрын
I =parsint(prompt("Enter a number")) 😊One closing bracket is remain
@Aashu.u. Жыл бұрын
Still doesn't work in my PC...😭😭
@shahnawazvhora39152 жыл бұрын
Bhai your video is outstanding ... and editing skill is great .. and jo aap bich bich main aap ye comedy karte hona apki video dekhna or padne ka bahot hi accha lagta ahai..😇
@masaudhusnainathar60812 жыл бұрын
This Code can also be run by this : Let obj = { Harry:90, Shubam:95, Anika:96 } for (let a in obj){ console.log(a); console.log(obj[a]); console.log("Marks of " +a+ " are " + obj[a]); }
@UjjwalMishra_68 Жыл бұрын
It can be also done by for of loop
@outofspeedyt2589 Жыл бұрын
I did the same thing LOL
@NamorFunctionStore Жыл бұрын
@@UjjwalMishra_68 no you cant use for of loop for objects The for...of loop is used to iterate over the elements of an iterable object, such as an array, a string, or a map. However, an object in JavaScript is not an iterable object, so you cannot use a for...of loop to iterate over its properties.
@faizanahmed9304 Жыл бұрын
You should always code it in a optimised way
@faizanahmed9304 Жыл бұрын
@@PawandeepKaur-k2c use document.body.innerHTML instead of document.write
@quixote61112 жыл бұрын
Harry Bhai, i would say at first when i started to learn the basics of web development from your channel, i often found out that you frequently say that you guys could do this on your own and as i was a beginner, things started to distract me from my path, i left learning and thought that there is not even a single person on youtube who wants the beginners of my age to learn how to code and everyone is just running for views and subscribers, but since i have accessed your current JS playlist, i would say that you are teaching with much more honesty than you did before. Keep up the good work. Always remember that there are people who don't say a lot but keep watching you and they feel themselves inferior in terms of their mental capability and they are afraid of writing comments, so to avoid humiliation and mockery from your young students, so when you teach, please make sure that you keep the slowest guys in mind. Hope you understand. Regards, Taimoor Khan, Punjab, Pakistan
@quixote61112 жыл бұрын
kzbin.info/www/bejne/jojEpoyXf9SdsJI
@motivational77672 жыл бұрын
Thank you, Harry, you have helped me a lot with these courses. May God bless you with success....😘
@sonalidhar4347 Жыл бұрын
Love javascript ❤.i think rules are appropriate and perfect in javascript..user-friendly
@rajeevk8112 жыл бұрын
Thanks Harry, You have made Js so so easy to learn and understand.
@Akshay6865 Жыл бұрын
Ultimate Javascript course is the best. :)
@AnitaMaurya-qo9fi Жыл бұрын
Bhaiya, your way of teaching is amazing,
@AsadUllah-cv2rl2 жыл бұрын
Ap ka course bohat hopeful h Please jaldi jaldi sy course complete kar di jy
@AryanRaj-bt6esАй бұрын
console.log("function to find mean of 5 numbers") function mean(a, b, c, d, e){ return (a+b+c+d+e)/5 } let a = prompt("enter number in place of a") let b = prompt("enter number in place of b") let c = prompt("enter number in place of c") let d = prompt("enter number in place of d") let e = prompt("enter number in place of e") console.log("The mean of 5 numbers are: " + mean(a, b, c, d, e) )
@aravinddev8708 Жыл бұрын
let object={ harry:98, rohan:70, aakash:7 } for(let a in object){ console.log("In Maths "+a+" got "+object[a]+" marks"); }
@Sachin-tr9zz2 жыл бұрын
Hme aapki jaroorat hai harry bhai. Har chiz ke lia
@manemanoj30682 жыл бұрын
maza aa gaya harry bhai
@MuhammadUsamaQamar2 жыл бұрын
The first question was actually very difficult to understand for a beginner
@_Rohit_Kumaar2 жыл бұрын
Not a difficult, it's a simple just watch video then practice in your local and then take a reference of #HarryBhai Code.
@umarjanbhat38192 жыл бұрын
U should understand arrays first... True
@karthikeyan87522 жыл бұрын
yes if javascript is your first language
@abhinavyadav28622 жыл бұрын
Correct
@harishkumar5272 жыл бұрын
Every body say javascript Is easy to learn but hard to master
@RAHULSHARMA-312 жыл бұрын
Harry Bhai aapse padh kr stress dur ho jataa hai. ❤
@bravcoder7 ай бұрын
harry bhai for question 3 you can do this: let cn = 4; let i; while (i != cn){ i = prompt("Guess the number") i = Number.parseInt(i) if (i != 4){ alert("Try again.") } } alert("You have entered the correct number.")
@souravranjanpradhan79042 жыл бұрын
Literally I love this intro , I watch it over and over again
@unknown60322 жыл бұрын
I am really enjoying this series thanks harry bhai for this much quality content.
@liamliam18202 жыл бұрын
ap ka course best ha bro bs aik video ko 3 3 dafa replay krta hon phir jaa k concept clear hota hai
@ankushsahu4321 Жыл бұрын
i day definitely you will be a stand up comedian
@royfamily9273 Жыл бұрын
Thanks Harry Bhaiya
@sunilkumar_vlogs2 жыл бұрын
1:23 Wah bhai maza aa gaya.... Thank You harry bhai for this enjoying and fun & amazing best js course
@samirjani83922 жыл бұрын
Harry sir's humor is getting better day by day 😂😂👍
@joybarman8351 Жыл бұрын
// print marks using for loop let marks ={ kartick:100, pankaj:32, saikat:65, joy:49 } let key = Object.keys(marks) for ( let i=0 ; i{ sumArg = 0 for (let i of args){ i = parseInt(i) sumArg += i } let mean = sumArg/args.length return mean } console.log("The actual mean is "+meanFunction(1,2,3,4,5,255,15,18))
@trainerzard7 Жыл бұрын
well done
@FSCO_sahilsatishchavan2 жыл бұрын
This playlist is the most helpful I have ever seen
@shivamtiwari42932 жыл бұрын
Knowledgeable👍👍👍 Thanks for making this JavaScript course🙏🙏🙏
@shivampandey-mc5qf Жыл бұрын
Else kyun nhi lgya bhai
@AmitKumar-xx7zj Жыл бұрын
Thank you Harry bhai for Practice Set
@itxchiii4 ай бұрын
4th question by taking inputs from user function mean( a,b,c,d,e) { avg = (Number(a) + Number(b)+Number(c)+Number(d)+Number(e))/5 console.log(avg) } for (let i x = prompt("enter x:") y = prompt("enter y:") z = prompt("enter z:") f = prompt("enter f:") g = prompt("enter g:") mean(x,y,z,f,g);
@slingshottherapper5937 Жыл бұрын
Great course. One minor mistake in question 3. You can see try again getting print even though the user hasn't entered anything yet. Correct solution : const cn = 5; var a = Number.parse int(prompt ("Enter a number")); while(a!==cn){ console.log("Try again"); a= Number.parseInt(prompt("Enter a number")); } console.log("You entered a correct number");
@SatyugHere2 жыл бұрын
1:25 😁😂 gajab bhai 🤘👌
@anshmittal56582 жыл бұрын
Hello Bhai we can do 7:57 question like this as well: while(true){ let a = prompt("please enter the number"); if(a==12){ console.log("You entered the right number") break } }
@siddhantkumar68012 жыл бұрын
You are right bro I also used the same way because i learned python👍👍👍👍
@anshmittal56582 жыл бұрын
@@siddhantkumar6801 I too learned Python
@introverthere66252 жыл бұрын
let cn = 66; let i; while(i!= cn){ i= prompt("type a number"); console.log("try again"); } console.log("that's right"); //will print try again
@M_Zubair5017 Жыл бұрын
Thank you very much. Sir.
@extreme_spices3652 жыл бұрын
He is not providing free knowledge. He is getting blessings and love of us
@armaanhusain69422 жыл бұрын
Thanks alot for this course!
@rohitpatle81702 жыл бұрын
Tumhare jaisa harddich nahi hai bro KZbinr Love from 12:10
your teaching style is awesome like you ❤❤😗😗 Harry bhai
@TheRottRider2 жыл бұрын
Subscribe Kara do Sir kzbin.info/www/bejne/bWndc3mbjMtphJI
@TheVedicWarrior2 жыл бұрын
THANK YOU SO MUCH BHAIYA FOR EVERYTHING ❤👀
@samsepiol80422 жыл бұрын
harry bhai interview me javascript se jo question puchte he unki practice karwa do
@tarunkumardeshmukh24082 жыл бұрын
Love from chhatisgarh (dalli rajhara)
@atulyasinghjadaun272 жыл бұрын
// Problem 3 let corrNum = 10; let isLoop = true; while(isLoop){ let inputNum = prompt('Enter the number'); if(inputNum==corrNum){ isLoop = false; } else{ isLoop = true; console.log('Try Again'); } } //That's the way I solved problem 3 and it worked
@razkvideos22552 жыл бұрын
thankyou so much sir giving this amazing opportunity
@fristanlobo12042 жыл бұрын
HI, we can also use the method : for (let i = 0; i < Object.keys(marks).length; i++) { console.log("The marks of ", Object.keys(marks)[i]," are ",Object.values(marks)[i] ) }
@umairsaeed5925 Жыл бұрын
a little bit changes in Problem No.3 for better understanding // Problem No. 3 let cn = 4; let i; while (i != cn){ i = prompt("Enter a number"); //check if above 'i' is not equal to the correct number if(i != cn){ console.log("Try again"); } } console.log("You have entered a correct number");
@asvadsagheer8351 Жыл бұрын
You can do this way too //Problem 3 let text = prompt("Enter correct number") for(let i = 0; i !== "43"; i++){if (text === "43") { alert("Perfect") break; } else{ text = prompt("Enter correct number") } }
@Vishal-il2mz2 жыл бұрын
Bahut badiya Harry da
@meetpatel3580 Жыл бұрын
Maja a raha hai herry bhaiii✨💫
@rajusheoran42 жыл бұрын
Ek hi to ❤️ h bhai kitni baar jeetoge
@shafinzaman61222 жыл бұрын
I am eagerly waiting for raising the bar!!
@tamannagupta52362 жыл бұрын
Hello harry Thank you so much . What an amazing course
@SunnyYadav-zv7hp Жыл бұрын
Thank you and love you bhaiya ❤️
@codewithjaffar2 жыл бұрын
Harry bhai we can't wait for the awesome projects
@studywithroman199710 ай бұрын
❤❤❤❤ nice tutorial sir
@anukashyap48172 жыл бұрын
Thank you so much harry bhai 🙏🙏🙏🙏
@ShadabKhan-ib7me2 жыл бұрын
Harry Bhai your keyboard sound is pretty good let us know about your keyboard specifications plz!
@priyanshutyagi_0200110 ай бұрын
Thankyou harry bhai❤
@dangersparky7374 Жыл бұрын
love you harry broooooooooooooooooooooooo you are my inspiration
@sayanmondal6798 Жыл бұрын
Thank You So Much
@deepakkumarvishwakarma6874 Жыл бұрын
let correctnum=10; let i; while(i!=correctnum){ i=prompt("Enter the number : "); if(i!=correctnum) console.log("try again"); else { console.log("You have enterd correct number."); } }
@samuelfrank13693 ай бұрын
Thanks a lot.
@AkashYadav-dl9bd2 жыл бұрын
🙏Harry bhai ek video hosting ki bna do starting se end Tak. Hosting me bahut confuse hu. Please bhai agar kisi shop wale ko website deliver karni ho jaha pe shop wale ke orders show honge to kaise database wali details deliver karni hai please bhai one video🙏🙏 ❤️ And this course is awesome 👌
@ahsanmushtaq0 Жыл бұрын
Weldone sir you are great
@crazyfire50162 жыл бұрын
Hello Harry I am Abbas I learned alot from your videos it really help me for my project. I want to suggest you to make a project on NFT Marketplace using react node and solidity. 😊
@rafatalam95722 жыл бұрын
#HarryBhai kisi bhi developer ko atleast kitni language aani chahiye aaj ke waqt me, aur kin laguage ka scope zyada hai is waqt. Please make a video on it.
@ubaidkhalif8880 Жыл бұрын
Maza aa raha hai Harry Bhai
@staticgkenglishgrammar Жыл бұрын
maja aa gaya bhai shab....
@syntax87822 жыл бұрын
Harry bhai Q3 me ak problem hai😬 Try again number enter krna se phele he print hora hai let cn = 8; do { n = prompt("Enter number 8: "); n = Number.parseInt(n); if (n == cn) console.log("Well done!"); else console.log("Try again"); } while (n != cn); is code se sahi se print hoga. by the way u r osm. Thanku for ur support.
@omsutar54982 жыл бұрын
Course is going good and I am enjoying !!!
@tiieej39505 ай бұрын
can also use for in loop to get marks from the object let marks={ harry:90, shubham:55, raj:60 } for(i in marks){ console.log("The marks of ",i,"is:",marks[i]); }
@zahoorahmedsayyad2 жыл бұрын
Congratulations for 100000 view on playlist.
@VivekGupta-ib8dy2 жыл бұрын
@CodeWithHarry This course immensely helps full for me, I love it very much and Thank you so much for guiding many people 🙏❤
@aaryangoklaney Жыл бұрын
for the third question is this code right let corecno=53 for(i=0;i!=corecno;i=prompt("Guess the no.")){ alert("try again") } console.log("You have guessed it right")
@ddsstrange64 Жыл бұрын
Yeah, It's working and better than the one harry has written in While loop.
@amitranjeetjha12402 жыл бұрын
This course is helpful
@sufianzulfiqar87932 жыл бұрын
Thanks harry bhai, tusi great ho ❤️ please more videos 🙏