JavaScript Chapter 6 - Practice Set | JavaScript Tutorial in Hindi #29

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2024

ความคิดเห็น • 505

  • @entertainingworld1546
    @entertainingworld1546 ปีที่แล้ว +46

    Even the paid courses also don't match with this level of quality content. Thank you so much bhaiya love you❤❤

  • @sameerahmedshaikh4479
    @sameerahmedshaikh4479 2 ปีที่แล้ว +207

    I am still remember when I quit my job to follow my passion. And CWH is the first channel where I completed my web development series. The way of teaching is awesome. And bhai jo meme use karta hai usse to maza hi ajata hai. Being a 2015 pass out with zero knowledge & confidence, nai laga tha karpuanga. But today I can proudly say that, I am working as a Full stack developer. Skhukriya Bhaii❤❤

    • @ujjawalmehrotra1995
      @ujjawalmehrotra1995 2 ปีที่แล้ว +5

      interviews ke liye kaise prepare kre plus kha se apply kre for interviews ?

    • @sameerahmedshaikh4479
      @sameerahmedshaikh4479 2 ปีที่แล้ว +10

      @@ujjawalmehrotra1995 frankly tell you. Mera aptitude utna sahi nai tha..so I tried internship. I started looking for companies jo internship k sath job offer de. And from internshala I found one company who hired me.

    • @uzmakhan2301
      @uzmakhan2301 2 ปีที่แล้ว +2

      Hii

    • @sameerahmedshaikh4479
      @sameerahmedshaikh4479 2 ปีที่แล้ว +1

      @@uzmakhan2301 Hii

    • @bhumishingh7664
      @bhumishingh7664 2 ปีที่แล้ว +1

      Hy

  • @abhishekgond7300
    @abhishekgond7300 2 ปีที่แล้ว +10

    4:04 Harry bhai do-while loop se question 2 ekdm perfect ho jaa raha
    do{
    let age = prompt("Enter your age");
    age = Number.parseInt(age);
    if(age>18){
    alert("You can drive")
    }else{
    alert("You can not drive")
    }
    }while(confirm("check again"))

  • @nadeemabdun8357
    @nadeemabdun8357 2 ปีที่แล้ว +35

    Bahut sari fun elements 🤣, Especially the loop one, Learning ki sath laughing that's what makes you special.💛

    • @hackerunknown8809
      @hackerunknown8809 2 ปีที่แล้ว +2

      Console. Tulu function barhiyaaa tha bhai

    • @kaushikrajit5169
      @kaushikrajit5169 ปีที่แล้ว +5

      Are Bass Kr Bhai 🤣🤣🤣

    • @xeno-m1194
      @xeno-m1194 ปีที่แล้ว +3

      Circus how gya dosto 😂😂

  • @MavericksBlue
    @MavericksBlue 2 ปีที่แล้ว +30

    Till now one of the best practice set 😂

  • @harshrajvarma4758
    @harshrajvarma4758 2 ปีที่แล้ว +20

    Harry bhai padhane ke sath sath entertainment ka bhi pura khyal rkhte hai🤣🤣🤣

  • @nabeelahmad8761
    @nabeelahmad8761 2 ปีที่แล้ว +8

    Big respect for you. You are doing such a great work.You are my motivation. God bless you.

  • @debabratadas4021
    @debabratadas4021 ปีที่แล้ว +6

    1- let a=prompt("you can drive");
    if (a

  • @vishalagarwal1971
    @vishalagarwal1971 2 ปีที่แล้ว +4

    Hey Harry, You did a great job. And "Thanks" is very small word for all of your efforts. I believe "God Bless You" will be more apprepreate for your cpntinous endless efforts.

  • @smartlearner333
    @smartlearner333 ปีที่แล้ว +3

    thank you so much harry bhaiya....as a student I was very confused about my career....but after following your videos and guidance today I am very confident and building projects in my own....thank you so much for educating us for free with such a dedication and hardwork....really thankful to you😃🥺

  • @ratneshsiddha
    @ratneshsiddha 2 ปีที่แล้ว +3

    Harry bhai , app bohot mst kaam krte ho harry bhai , please esehi tutorial bnate rho, may God bless you a healthy and wealthy life

  • @sukanyas4218
    @sukanyas4218 ปีที่แล้ว +1

    Today i solved all the prblms without looking to ur solution Really very happy today🤩 i was the one who had zero coding knowledge ,but now bcz of u i am coding at one level .Thanku soo much harry. U r the best teacher ever

  • @saddubhaiii
    @saddubhaiii ปีที่แล้ว +2

    Your humour is on point😂😂....Love to learn from you❤❤

  • @aaqibalam4221
    @aaqibalam4221 ปีที่แล้ว +3

    Sir,
    Your lectures are absolutely fantastic.....
    Lots of information with memes....
    It makes the lecture super awesome! 💐⚡

  • @akashpatil9865
    @akashpatil9865 ปีที่แล้ว +2

    11:49 / 12:46 -
    document.body.style.background= prompt("Enter colour: ");

  • @shivamraj1784
    @shivamraj1784 ปีที่แล้ว +2

    Hey Harry in the second question there's a more simplest way to run the program let age= 18;
    let a =prompt("Enter Your Age Here")
    if (a>=age) {
    alert("You can drive")
    confirm("You want to see the prompt again")
    let a =prompt("Enter Your Age Here")
    }
    else{
    alert("You cannot drive")

    }

    • @2ameridiem
      @2ameridiem ปีที่แล้ว

      incorrect code. if someone is below the age of 18, the else block will run and the program ends. they won't be able to view the prompt again. you wanna keep asking the user if they wanna see the prompt and only stop when they press cancel.

    • @2ameridiem
      @2ameridiem ปีที่แล้ว

      let age = prompt('enter age')
      age = Number.parseInt(age);
      if (age >= 18)
      alert('you can drive!')
      else alert('cant drive!')
      let run = confirm('wanna see prompt again?');
      while (run) {
      age = prompt('enter your age')
      age = Number.parseInt(age);
      if (age >= 18)
      alert('you can drive!')
      else alert('cant drive!')
      run = confirm('wanna see prompt again?');
      }
      try this

  • @bemadamigos6622
    @bemadamigos6622 2 ปีที่แล้ว

    11:48
    Bhaisaab humour ekdum top tier hai 🤣🤣🤣

  • @shydcuk
    @shydcuk ปีที่แล้ว +5

    Problem 2 :
    let a = prompt("Enter The Age : ");
    let b = confirm("Do you want to see prompt again")
    while(b){
    a = prompt("Enter The Age : ");
    a = Number.parseInt(a);
    b = confirm("Do you want to see prompt again")
    }
    a < 18 ? alert("you cannot drive") : alert("you can drive") ;

    • @neoanderson7528
      @neoanderson7528 10 หลายเดือนก่อน

      what the point of writing the last conditional expression when neither it is under any variable or nor its is under the loop .. how you gonna call it ? i guess if you have wrote it than there must be use of it

  • @shivamtiwari4293
    @shivamtiwari4293 2 ปีที่แล้ว +2

    Knowledgeable👍👍👍 Thanks for making this JavaScript course🙏🙏🙏

  • @optimus2793
    @optimus2793 2 ปีที่แล้ว +5

    This course is best i am loving❤️ it harry bhai💯😚🔥🔥🔥
    One small request try to increase frequency of video :-)

  • @williamahsan1010
    @williamahsan1010 2 ปีที่แล้ว +1

    4:42 Harry bhai Problem No 2 me best approach tha ki do while loop use karte

  • @BLACKWIZX
    @BLACKWIZX 3 หลายเดือนก่อน

    are bas kar bhaiii was epic , one of the best js series on youtube ever

  • @internetgeek8728
    @internetgeek8728 2 ปีที่แล้ว +1

    VERY SIMPLE WAY TO DO "Q2" Harry Bhaiya!!
    function drive() {
    alert(` ${((prompt("Enter your age:")) < 18) ? "No, You cannot drive!!" : "Yes, You can drive"} `)
    }
    drive()
    let permission = confirm("Wanna see the 'prompt' again?")
    if (permission){
    drive();
    }else{
    console.log('ok')
    }

  • @Abhay_Rangera
    @Abhay_Rangera ปีที่แล้ว

    11:49 maajaaaaaaaa hi aa gya yr 🤣🤣🤣🤣🤣🤣🤣

  • @asifali-fc8xt
    @asifali-fc8xt 2 ปีที่แล้ว +2

    your lectures play very important role in my learning

  • @dearprogrammer3455
    @dearprogrammer3455 ปีที่แล้ว

    11:49 Maan lo maine magenta kiya
    Aree bss krr bhai
    Harry bhai tussi great ho
    Matlab padhai ke sath memes bhi😂😂

  • @BLACKWIZX
    @BLACKWIZX 3 หลายเดือนก่อน +1

    0:24 chalo bhaiii

  • @saurabhwadekar8110
    @saurabhwadekar8110 ปีที่แล้ว

    Are bas kar bhai meme!!!!!!!!!!😃😃 Quality content!!!!!!!!!!!!!!!!!!!!!

  • @sandiproy3417
    @sandiproy3417 2 ปีที่แล้ว

    Harry bhaiya maja araha hai 🥰🥰🥰😍😍😍😍🤩

  • @haroonkhan1040
    @haroonkhan1040 2 ปีที่แล้ว +2

    You are so good teacher.
    Love 😍 from PAKISTAN ❤️❤️❤️❤️

    • @littleexperiance2147
      @littleexperiance2147 2 ปีที่แล้ว

      pakistan kha say Any body now difference between java and Javascript

  • @maazkhan5410
    @maazkhan5410 ปีที่แล้ว

    3:25
    let age = prompt("Enter your age")
    if(age

    • @NamanCodes
      @NamanCodes ปีที่แล้ว

      its wrong you have not converted the age from string to integer

  • @FandM-d5k
    @FandM-d5k 2 ปีที่แล้ว +1

    Best teaching harry bhai 🔥🔥

  • @WorldCommunityCorner
    @WorldCommunityCorner 2 ปีที่แล้ว +2

    Thank You very very much for this amazing practice set ❤🌹🙏

  • @inf008shorts
    @inf008shorts ปีที่แล้ว

    I first tried it myself. And then see your answer. I found a better way to do 1 question.

  • @toufikumar7169
    @toufikumar7169 2 ปีที่แล้ว

    Maja a geya video dekh kar 👍😍

  • @muhmmadarshadmuhmmadarshad3054
    @muhmmadarshadmuhmmadarshad3054 2 ปีที่แล้ว +1

    Thanku so much sir today is my internal practical exam in uni

  • @mi.ve_arts
    @mi.ve_arts ปีที่แล้ว

    oh bas kar bhai was superb

  • @s2ndanish473
    @s2ndanish473 2 ปีที่แล้ว

    Machate Raho 🤘

  • @codingwithshiku4735
    @codingwithshiku4735 ปีที่แล้ว

    harry bhai maza aa gya sukriya bhai

  • @KaushalDonga
    @KaushalDonga 7 หลายเดือนก่อน

    wahhh harry bhai last me color wala bus kr bhai very funny🤣🤣🤣 tusi greate ho bhai

  • @oneminutenews6771
    @oneminutenews6771 2 ปีที่แล้ว +2

    while (c = 1) {
    let age = prompt("enter your age")
    const canDrive = (age) => {
    return age >= 18 ? true : false
    }
    if (canDrive(age)) {
    alert("you can drive")
    let c = 0
    break
    }
    else {
    alert("you can't drive")
    let c = 1
    }
    }

  • @AKitexpert
    @AKitexpert 2 ปีที่แล้ว

    harry bhai ajj ti practice boht achi thi maza agaya

  • @pranshukaushik7104
    @pranshukaushik7104 2 ปีที่แล้ว +1

    Thanku for all the efforts u are making to teach us 😄😄😄😄

  • @noonedotcode
    @noonedotcode 6 หลายเดือนก่อน

    We can Do
    let age = parseInt(prompt('Enter Your Age'))

  • @sameerkun
    @sameerkun 2 ปีที่แล้ว +1

    I was watching so seriously but then this came 00:11:50

  • @MathsKingRavi
    @MathsKingRavi 3 หลายเดือนก่อน +1

    Thank you sir and Big brother

  • @wahabkhokhar8826
    @wahabkhokhar8826 2 ปีที่แล้ว

    Most amazing I love it ab interest barh raha hai bhai

  • @technikalproblem6780
    @technikalproblem6780 2 ปีที่แล้ว +1

    Thank you so much sir for creating this video for us!

  • @anshumanpandey109
    @anshumanpandey109 2 ปีที่แล้ว +4

    // problem 5(while using geting console error )
    let color = prompt("Enter the page background color")
    document.body.style.background = color
    VM29:1 Uncaught SyntaxError: Identifier 'color' has already been declared
    and in BOM and DOM concept getting error:
    console.log(document.body)
    document.style.background = "yellow"
    null
    28.js:3 Uncaught TypeError: Cannot set properties of undefined (setting 'background')
    at 28.js:3:27
    28.html:40 Live reload enabled.

    • @mukunda-w9j
      @mukunda-w9j ปีที่แล้ว +1

      Write this
      windows.onload=function(){
      Let color=prompt("enter a color")
      document.body.style.background=color
      }

  • @GeetaChaudhary-o9p
    @GeetaChaudhary-o9p 11 หลายเดือนก่อน

    very interesting lecture. thank u bro very helpful thank u for giving these lectures for free

  • @educationalxentertainmente9351
    @educationalxentertainmente9351 2 ปีที่แล้ว +1

    Ex.2 =
    do{
    a = prompt("enter your age")
    a = Number.parseInt(a)
    sure = confirm("Do you want to re-enter your age? If yes then click 'yes' else 'cancel'")
    }while(sure)
    if (a>=18){
    alert("you can drive")
    }
    else{
    alert("you can't drive")
    }

    • @littleexperiance2147
      @littleexperiance2147 2 ปีที่แล้ว +1

      Any body now difference between java and Javascript

    • @educationalxentertainmente9351
      @educationalxentertainmente9351 2 ปีที่แล้ว

      @@littleexperiance2147 don't get confused between JS and Java they both are very different. like you can't compare appple and banan that's how can't compare JS and Java.One major difference between them is JS is use for Web development and Java is use for app development.
      Now you understand difference between them.
      Don't get confused by their name.

    • @littleexperiance2147
      @littleexperiance2147 2 ปีที่แล้ว

      @@educationalxentertainmente9351 Thanks dear so much

  • @priyanshubehera8085
    @priyanshubehera8085 2 ปีที่แล้ว

    Love you bro ...
    Here are the solutions before watching your code
    Q1)let age = prompt("Enter the age :")
    age=Number.parseInt(age)
    if (age > 18) {
    alert("You can drive")
    }
    else {alert ("You can't drive ")}
    Q2)let age = prompt("Enter the age :")
    age=Number.parseInt(age)
    if (age > 18) {
    alert("You can drive")
    }
    else {alert ("You can't drive ")}
    confirm ("Do you wanna see the prompt again")
    if (age > 18) {
    alert("You can drive")
    }
    else {alert ("You can't drive ")}
    Q3) let age = prompt("Enter the age :")
    age=Number.parseInt(age)
    if (age 18) {
    alert("You can drive")
    }
    else {alert ("You can't drive ")}
    Q4) smajhhh m nhi ayaa :((
    Q5)let color=prompt("Enter the color name you want to apply to the background");
    document.body.style.backgroundColor= color ;

  • @LovepreetKumar-us6gw
    @LovepreetKumar-us6gw 20 วันที่ผ่านมา

    Thanks buddy, You are amazing!

  • @s2ndanish473
    @s2ndanish473 2 ปีที่แล้ว +1

    Harry bhai is great 🔥

    • @mohdnaeemkhan8
      @mohdnaeemkhan8 2 ปีที่แล้ว

      Bhai kon si ide use kr rahe hai is video me?

    • @roster6292
      @roster6292 2 ปีที่แล้ว

      @@mohdnaeemkhan8 ye replet he

  • @shreyashtidke5269
    @shreyashtidke5269 2 ปีที่แล้ว +1

    Very good explanation..

  • @dipakchaudhari8245
    @dipakchaudhari8245 2 ปีที่แล้ว +5

    Thank you sir i learnt alot From you and Tomorrow is my internal practical exam in college and this will help me ❤️🙏🏻

    • @Gamer_0057
      @Gamer_0057 2 ปีที่แล้ว +1

      Bhaiya toh kya colleges mai js bhi sikhya jata hai? kon se semester mai? (im in class 8)

    • @littleexperiance2147
      @littleexperiance2147 2 ปีที่แล้ว +1

      Any body now difference between java and Javascript

    • @amanthakur11998
      @amanthakur11998 2 ปีที่แล้ว +1

      @@Gamer_0057 i think this guy belongs to a computer science or IT. If you are done your 12th in math/subject you can go btech in computer science/IT. or if you are commerce student you can go with BCA or bsc in computer science. All the best for your future 👍👍

    • @amanthakur11998
      @amanthakur11998 2 ปีที่แล้ว +1

      @@littleexperiance2147 javascript is a scripting language where as java is a programming language

    • @anjum9203
      @anjum9203 2 ปีที่แล้ว

      @@littleexperiance2147 java is a programming language which pure object oriented programming language.
      While Javascript is a scripting language which is used with other programming language to do changes without reloading the site.
      Like ajax

  • @AARTIDEVI-sr1px
    @AARTIDEVI-sr1px 2 ปีที่แล้ว

    Thanks bro app ki mene python in 15 hours wali video dekhi bhot ache se app ne python samjhaya hai thanks 😊😊 use video mai aapko thank nahi bol paya isliye aapki lastest video mai de raha hu😅

  • @akashkumbhar3791
    @akashkumbhar3791 ปีที่แล้ว

    maja aa raha hai ...big boss

  • @utkarshsinghtiwari5424
    @utkarshsinghtiwari5424 2 ปีที่แล้ว

    Thanks Harry bhai 😊😊

  • @kumarvlogs298
    @kumarvlogs298 ปีที่แล้ว

    The best video of the playlist up till now
    The comedy level of harry bhai in this video is at a next hype......
    Love you harry bhaiya...
    One day I will meet you.....
    The biggest motivator for me.......@CodeWithHarry

  • @vivekkapil4571
    @vivekkapil4571 ปีที่แล้ว

    Thanks Harry bhai for providing a cool js playlist 🎉

  • @usamabaig8591
    @usamabaig8591 5 หลายเดือนก่อน +1

    Q:2
    let runAgain= true;
    function canDrive (age){
    return age >= 18 ? true : false
    }
    while (runAgain) {
    let age = prompt("Please Enter the age:")
    age = Number.parseInt(age)
    if (age >= 18){
    alert("you can drive")
    }
    else{
    alert("you can not drive")
    }
    runAgain = confirm("Do you want to play again?")
    }

  • @Alone42
    @Alone42 2 ปีที่แล้ว

    💕 best chennall on TH-cam harry BHAi

  • @jaspreetsinghdwakhari9570
    @jaspreetsinghdwakhari9570 ปีที่แล้ว

    adhbut attttti uttaaam

  • @PRALAY.THAKUR
    @PRALAY.THAKUR ปีที่แล้ว

    Nice explainnation 🎉🎉

  • @rulebreaker4384
    @rulebreaker4384 2 ปีที่แล้ว

    Allhmdulliah done with lectr 29 .. love from Pakistan

  • @shwetashrivastava8374
    @shwetashrivastava8374 2 ปีที่แล้ว +1

    thnku so much for this series

  • @REDISCOVERTHEWORLD
    @REDISCOVERTHEWORLD ปีที่แล้ว

    practice 2nd
    do{
    let age=prompt("enter age");
    age>25?alert("eligible"):alert("not eligible");
    }
    while(confirm("you want to see again"))

  • @一百零八萊奧桑德
    @一百零八萊奧桑德 ปีที่แล้ว

    bas kar bhai was on point🤣

  • @CVR2113
    @CVR2113 14 วันที่ผ่านมา

    function test(){
    let a = prompt("Enter your age");
    a = parseInt(a);
    if(a >=18 ){
    alert("You can drive!");
    }else{
    alert("You cannot drive!")
    }
    let con = confirm("You want to check again");
    if(con){
    test();
    }
    }
    test();
    use reccursion

  • @aswineepratihari7897
    @aswineepratihari7897 2 ปีที่แล้ว

    7:38

  • @SunehraTabassum-sx2dh
    @SunehraTabassum-sx2dh หลายเดือนก่อน

    here is how i coded :
    let question = prompt("Enter Your age");
    question = Number.parseInt(question);
    const rungain = ()=>{
    prompt("do you want to enter age again?")
    }
    const candrive = ()=>{
    if(question >= 18){
    alert("you can drive")
    }
    else {
    alert("you cannot drive")
    }
    rungain()
    }
    candrive();

  • @usamabaig8591
    @usamabaig8591 5 หลายเดือนก่อน +1

    let age =prompt("Please Enter the age:")
    if (age>=18){
    alert("you can drive")
    }
    else{
    alert("you can not drive")
    }
    Question:1

  • @priyanshutyagi_02001
    @priyanshutyagi_02001 10 หลายเดือนก่อน

    Thankyou harry bhai❤

  • @devtomar8472
    @devtomar8472 11 หลายเดือนก่อน

    ❤❤ se Thank you for 29

  • @036akberhussain
    @036akberhussain ปีที่แล้ว

    solution for 2nd question can be done using do-while loop
    do{
    let age = Number.parseInt(prompt("Enter your age "))
    if (age < 18) {
    alert("You are under 18. You cannot drive")
    }
    }while(confirm("Do you want to enter age again ?"));

  • @cg.yamangaming4632
    @cg.yamangaming4632 ปีที่แล้ว

    Bhaiya your Net Time dailog very owsome

  • @Demon-Senpai
    @Demon-Senpai 2 ปีที่แล้ว +1

    by practicing and watching ur videos i have improved in codding console.tullu

  • @dinoraj9049
    @dinoraj9049 ปีที่แล้ว

    Harry bhaiya is the best

  • @vishalkhandla6791
    @vishalkhandla6791 4 หลายเดือนก่อน

    Most funny video till now , all of the meme are on point 🤣🤣

  • @tejasmahakalkar9392
    @tejasmahakalkar9392 11 หลายเดือนก่อน

    5:05 -> Us Harry Bhai Us!!!!!😂😂😂

  • @Lv_La_Lr
    @Lv_La_Lr 2 หลายเดือนก่อน

    Harry Sensei OP ❤❤

  • @anubratachakraborty8962
    @anubratachakraborty8962 2 ปีที่แล้ว +1

    Q1.
    let user = prompt('Enter your age');
    user = Number.parseInt(user);
    let ans = user>18 ? 'You can drive' : 'Sorry you are under age';
    alert(ans);

  • @irshadshaikh3431
    @irshadshaikh3431 2 ปีที่แล้ว

    next level editing

  • @shahwy92
    @shahwy92 ปีที่แล้ว

    Harry bhai u r inspiration of many of us ❤ se thank you for such content for free gives always a motivation to become a successful developer

  • @ganeshparjapt1731
    @ganeshparjapt1731 2 ปีที่แล้ว

    aaare bass kar baiiiii
    bichh jo comedy ke liyee thanksss 🤨😜😜

  • @shrabonisinha
    @shrabonisinha ปีที่แล้ว

    The last one is very amazing

  • @GameWithStuff
    @GameWithStuff ปีที่แล้ว

    Q2 mein do while loop use karna chahiye tha na boolean variable ki jagah

  • @user-void.04
    @user-void.04 2 ปีที่แล้ว +1

    Tysm brother

  • @ashutoshdash140
    @ashutoshdash140 2 ปีที่แล้ว +1

    harry bhai😂, mere saath bhi same isuue hogaya tha, mera bhi infinite loop me chalagaya tha ek baar, phir new repl bana liya.

    • @sachigoyal9300
      @sachigoyal9300 8 หลายเดือนก่อน

      But how to solve that one?

  • @factwithsujal4676
    @factwithsujal4676 ปีที่แล้ว

    second
    alert("enter your age");
    let run=true;
    while(run){
    let a= prompt("age");
    let b = parseInt(a);
    if(b>=18){
    alert("you can drive");
    }
    else{
    alert("you cannot drive");
    }
    run=confirm("you want again")};

  • @factwithsujal4676
    @factwithsujal4676 ปีที่แล้ว

    question 1 simple
    alert("enter your age");
    let a= prompt("age");
    let b = parseInt(a);
    if(b>=18){
    alert("you can drive");
    }
    else{
    alert("you cannot drive");
    }

  • @yawarnoor2739
    @yawarnoor2739 2 ปีที่แล้ว +1

    Hi, harry bhai. Hope you doing well!
    can't we just use if conditional in Q1 which is very easy and convenient. what is the point of creating a function here?

  • @no1typist
    @no1typist ปีที่แล้ว

    Thanks a bunch!

  • @mayurchotaliya5375
    @mayurchotaliya5375 ปีที่แล้ว

    Q-2 let playagain = true
    while(playagain){
    let age = Number(prompt(`Enter your age`));
    alert(age>18? `you can drive` : `you can't drive`)
    playagain = confirm(`do you want to play again`);
    }

  • @tanmaykhatri6061
    @tanmaykhatri6061 2 ปีที่แล้ว +1

    I solved first question in just one line of code:
    alert(`You can${Number.parseInt(prompt("What is your age"))

  • @Ravi-oh8xz
    @Ravi-oh8xz 2 ปีที่แล้ว

    Thanks Harry bhai

  • @PranjalDLuffy
    @PranjalDLuffy ปีที่แล้ว

    6:40 crazy dead loop 🤣

  • @AdityaSingh-x2x
    @AdityaSingh-x2x ปีที่แล้ว

    Another method to write the same code!!!
    do {
    let age = prompt("What is your age.")
    age = Number.parseInt(age)
    if (age >= 18) {
    alert("You are eligible for drive.")
    }
    else if ( age < 0){
    console.error("You entered an invaild age.")
    }
    else{
    alert("You should wait for " + (18 - age) + " years to be eligible to drive." )
    }
    } while(
    confirm("Do you want to play agian.") == true
    )

  • @varadacharya2802
    @varadacharya2802 ปีที่แล้ว

    the question2 can be solved using do while loop also
    let age;
    let again = 1;
    const canDrive = (age) => {
    return age >= 18 ? true : false;
    };
    do {
    let age = prompt("enter your age : ");
    age = Number.parseInt(age);
    if (canDrive(age)) alert("You can drive");
    else alert("You cannot drive");
    again = confirm("Do you want to play again ?");
    } while (again);