Javascript Coding Challenge #19: Roman Numeral Converter (Freecodecamp)

Sdílet
Vložit
  • čas přidán 2. 07. 2024
  • 🔥 Get my FREE project-based Javascript course, zeeee best Free Javascript course in the world, at www.whatsdev.com!
    *FOLLOW ME!
    ►INSTAGRAM @zinnylives
    ►Business Only: tenzin@whatsdev.com
    MY EQUIPMENT LINKS TO AMAZON
    The mic I use to record my golden voice - amzn.to/2E3bAEq
    The laptop I use to edit my LIT videos - amzn.to/2H00cwx
    The keyboard I use to code - amzn.to/2GRnODr
    The most ergonomic mouse that I use all the time - amzn.to/2NkVWIX
    The best android phone on the market - amzn.to/2TWYbo9
    The camera I use to shoot my awesome videos - amzn.to/2BKC7X2
    My 4K mirrorless camera - amzn.to/2E31WBL
    The best Gaming Desktop - amzn.to/2XgDea7
    The best bang-for-buck 4K UHD IPS Monitor - amzn.to/2U0C7cx
    The best 29" UltraWide Screen LED-Lit Monitor - amzn.to/2GVVoYI
    The memory card I use - amzn.to/2TYawIQ
    My High-Def PRO webcam - amzn.to/2U2jIMy
    The best storage for my ever-growing collection - amzn.to/2NqV85z
    The flash drive I use - amzn.to/2T82PCB
    The best Digital Wireless Microphone - amzn.to/2E2YXJz

Komentáře • 91

  • @alanrichards6367
    @alanrichards6367 Před 2 lety +9

    I feel like most people just don't have the patience to explain every little detail like this. So, thank you for taking the time to do it.

  • @tavarespablo
    @tavarespablo Před rokem +4

    Thanks a lot for having the patience to explain in such great detail while having a cold!

  • @heyimanh
    @heyimanh Před 4 lety +25

    "if it hurts your brain, that's a good sign, because that means you're learning something" amen. thanks for your high quality videos!

  • @mygoodshitzzz
    @mygoodshitzzz Před rokem +3

    I got to say I really love how you actually take the time to explain the code in detail!!! This is by far the best tutorial on this challenge.

  • @TheBytao7mao
    @TheBytao7mao Před 6 lety +36

    10+++ for explanation again, you have a huge gift for explanations dude ! thanks

    • @whatsdev
      @whatsdev  Před 6 lety +2

      Thanks Nicolae! I appreciate it 😃

    • @suraj-ram7488
      @suraj-ram7488 Před 5 lety

      Yes definitely

    • @yeetmam3657
      @yeetmam3657 Před 3 lety

      best explanation 10/10 I just got this karta today and now I understand this

  • @luizmelo8611
    @luizmelo8611 Před 6 lety +7

    Maan this explanation was awesome! The best one I've seen so far. Congrats and thank you!

  • @hartdev05
    @hartdev05 Před 3 lety +1

    Love the way how you walk us through the code! subscribed! Thanks a lot!

  • @GapBruno360
    @GapBruno360 Před 3 lety

    Bro this series of videos are gold, thank you so much!

  • @anshulmanapure1980
    @anshulmanapure1980 Před 2 lety +3

    The explanation and the code were a piece of art.

  • @viacheslavpak2394
    @viacheslavpak2394 Před 3 lety

    Oh my God thank you for the great explanation! I started to learn javascript a week ago, I'm given a assigments to make a function that converts digits into latters...was so lost but this video gave a hint and a better understanding of loops and function! Thank you again!!!

  • @codeitraw5241
    @codeitraw5241 Před 2 lety +2

    wow.... you are the best at explaining logic. Some people goes on and on for nothing.. I need to definitely join your course.

  • @pooja3711
    @pooja3711 Před rokem +2

    i really love your way of explaining the concepts.hatsoff !.For beginners its a key ...

  • @alexlytle089
    @alexlytle089 Před 4 lety

    THANK YOU SO MUCH. I had to watch this about 10 times but its so clear now

  • @olivia4788
    @olivia4788 Před 5 lety +1

    Thank you!!! I'm going to keep practicing. Great explanation!!

  • @ritai.3089
    @ritai.3089 Před 3 lety +1

    Damn!! It's PERFECT!! so simple, clear!! Please make more videos!

  • @AntNewgen
    @AntNewgen Před 3 lety

    Amazing explanation
    Thanks for all of your videos. They're really helping me understand every challenge in Free Code Camp!

  • @alexnavarro3221
    @alexnavarro3221 Před 2 lety

    Thanks a lot guy! this is a perfect and clear explanation

  • @Ermosparis
    @Ermosparis Před 4 lety

    Best clear solution, simple and efficient

  • @aryamol5346
    @aryamol5346 Před rokem

    Detailed explanation.. Thank you so much

  • @jovannikolic6346
    @jovannikolic6346 Před 4 lety

    That's a great explanation. Thanks!

  • @tiffanyvalentina6773
    @tiffanyvalentina6773 Před 3 lety

    Beautifully and simply composed; excellent and clear explanation. Thank you!

    • @lindatochukwu3081
      @lindatochukwu3081 Před rokem

      hey dear, am linda and u? am from Nigeria? can i be your friend? sorry i saw ur comment on youtube channel, are you a developer?

  • @lindatochukwu3081
    @lindatochukwu3081 Před rokem

    i am glad i came across this....thanks alot !!!

  • @wongtszpong
    @wongtszpong Před 2 lety

    Thanks a lot, bro. You save my day.

  • @abhishekmagar9843
    @abhishekmagar9843 Před rokem

    Wow, how easily you explaining thank you

  • @harunaoseni555
    @harunaoseni555 Před 3 lety

    I had to comment, thank you Tenzin, implementing your solution to my wagon!

  • @abhinavkumar8396
    @abhinavkumar8396 Před 3 lety

    I was talking your chanel lightly until I understood this great example by you, awesome explanation;👍

  • @horacecarter2081
    @horacecarter2081 Před 5 lety

    can you continue to make these videos? i am teaching myself every single one over and over until its ingrained my brain.

  • @mrpotterandrew
    @mrpotterandrew Před 6 lety +6

    oh man that was so simple. i wrote almost 3 pages of code to do what your few lines of code does

  • @apel1151
    @apel1151 Před 2 lety

    You are an absolutely cool guy!!!!!

  • @prathameshmali3888
    @prathameshmali3888 Před 4 lety

    Very helpful, great explaination.

  • @faisalrana9945
    @faisalrana9945 Před 3 lety +2

    massive difference between watching someone do this.. and coming up with it yourself.. if you read this.. can you remember if when you were starting out.. something like this seems almost impossible to come up with on your own? im good at understanding things.. i just have trouble with creation sometimes. im in a code camp right now

  • @AsifKhan-md7jy
    @AsifKhan-md7jy Před rokem

    ohhhhh! Mind blowing explanation brother , keep helping students u r doing such a great work stay bless and happy ,and make more videos like this and thank u for this

  • @mobeenrajpoot5315
    @mobeenrajpoot5315 Před 10 měsíci

    You are the best!

  • @zathkal4004
    @zathkal4004 Před 3 lety

    Awesome explanation man.... thanks (:

  • @tobhiro
    @tobhiro Před rokem

    You did a great job

  • @victortarroni
    @victortarroni Před rokem

    Thank you!

  • @ahmedalruqaishi7312
    @ahmedalruqaishi7312 Před 10 měsíci

    thank you so much !

  • @sherwinsayo8602
    @sherwinsayo8602 Před 2 lety

    i like the way you explain

  • @millerxcrunning
    @millerxcrunning Před 5 lety

    @whatsdev Thanks for the awesome walk through! Can you elaborate on using a for in loop and whether the order of execution is predictable? I was under the impression that for in loops happen in arbitrary order.

  • @JJ-ww6pm
    @JJ-ww6pm Před rokem

    Thank you 😊

  • @burnlastsunday
    @burnlastsunday Před 3 lety

    think i need to buy jab-jab-javascript. you are a remarkable teacher and you make everything make sense. zero bullshit 100% results. i expect it will be the hardest thing i've ever done and i'm looking forward to it. let's GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!

  • @sammalik8170
    @sammalik8170 Před 3 lety

    Thanks bro❤️

  • @lycan2494
    @lycan2494 Před 5 lety +1

    sounds simple but why are the object keys have to be exactly in this pattern to beat the challenge?
    M:1000,
    CM:900,
    D:500,
    CD:400,
    C:100,
    XC:90,
    L:50,
    XL:40,
    X:10,
    IX:9,
    V:5,
    IV:4,
    I:1

  • @xnetch2024
    @xnetch2024 Před 2 lety

    *good explanation*

  • @scottldn
    @scottldn Před rokem

    That’s a nice solution. I used a massive switch statement to pass the test but this is a better option 😅

  • @thecapletsecurity7316
    @thecapletsecurity7316 Před 3 lety +1

    The order in which you defined your object is must otherwise if you shuffle the object value randomly then it never generate the original results eg:- shuffle the whole object in random order and then try for 1000

  • @tod670
    @tod670 Před 3 lety

    thanks great content! get better!

  • @meenakshichandani
    @meenakshichandani Před 4 lety

    very helpful thanks dear

  • @iteachyouleech5939
    @iteachyouleech5939 Před 3 lety

    What do you think about creating a function that lets you put in lazy numbers e.g IIII, VIIII and regular numbers to convert to Roman numerals?

  • @frozen4083
    @frozen4083 Před 6 lety +2

    Feel better man!

    • @whatsdev
      @whatsdev  Před 6 lety +1

      NoahH Thanks man! Trying lol 😂

  • @alexlytle089
    @alexlytle089 Před 4 lety

    How did you come up with the values you inserted in your key-value pair?? They seem to be random roman numerals descending from 1000

  • @tiffanychan478
    @tiffanychan478 Před 3 lety

    Thank you for the video. What is the difference if the key-value starts from I:1 in romanToNum objects?

  • @nouceirnossa634
    @nouceirnossa634 Před 2 lety

    thank u sooooooooooo much

  • @yoyocr2034
    @yoyocr2034 Před 3 lety

    I am so sad , this beautiful series has no more videos..

  • @tuhairweronnie7385
    @tuhairweronnie7385 Před 4 lety

    Tanzan thanks for the challenges but this last of numerical i only saw stars........ may be i will keep revising and see if i can get it but i think i leaent alot from the challenges. thank man......buy you monster one day

  • @codenjourney6656
    @codenjourney6656 Před 4 lety

    Just tried with another roman numerals set and it doesn't work. Does it have to be the dataset you showed?

  • @FahadKiani1
    @FahadKiani1 Před 4 lety

    where is the guitar??

  • @damaroro
    @damaroro Před rokem

    what about using hashmap to solve this challange ?

  • @AmanKumar-pb6om
    @AmanKumar-pb6om Před rokem

    but what if we do num-9 then how will it print IX

  • @JustinDAMusic
    @JustinDAMusic Před rokem +1

    1:24 That's what she said😂

  • @fujiipo
    @fujiipo Před měsícem

    tanks dude - brazil is watching y

  • @dboydomr
    @dboydomr Před 2 lety

    Before watching this vid I came up with this. Is there any reason I should have gone the route the video maker went with? My algo beat the challenge but is there room for improvement?
    function convertToRoman(num) {
    function unit(x) {
    switch(x) {
    case 1: return 'I';
    case 2: return 'II';
    case 3: return 'III';
    case 4: return 'IV';
    case 5: return 'V';
    case 6: return 'VI';
    case 7: return 'VII';
    case 8: return 'VIII';
    case 9: return 'IX';
    }}
    function tens(x) {
    switch(x) {
    case 1: return 'X';
    case 2: return 'XX';
    case 3: return 'XXX';
    case 4: return 'XL';
    case 5: return 'L';
    case 6: return 'LX';
    case 7: return 'LXX';
    case 8: return 'LXXX';
    case 9: return 'XC';
    }
    }
    function hun(x) {
    switch(x) {
    case 1: return 'C';
    case 2: return 'CC';
    case 3: return 'CCC';
    case 4: return 'CD';
    case 5: return 'D';
    case 6: return 'DC';
    case 7: return 'DCC';
    case 8: return 'DCCC';
    case 9: return 'CM';
    }}
    function thou(x) {
    switch(x) {
    case 1: return 'M';
    case 2: return 'MM';
    case 3: return 'MMM';
    case 4: return 'MMMM';
    }
    }


    let arr = String(num).split("")
    let arr2 = []
    for (let i=0;i

  • @carminetambascia6355
    @carminetambascia6355 Před 2 lety

    Would be interesting to come up with a solution without the mapping object

  • @Rgroose
    @Rgroose Před 6 lety +4

    cool

  • @colose-qw6bh
    @colose-qw6bh Před 3 lety

    I just can't get how can someone still unlike that

  • @user-qx7lb5qc9m
    @user-qx7lb5qc9m Před 4 lety

    nice

  • @suraj-ram7488
    @suraj-ram7488 Před 5 lety

    Does the order of roman numerals(descending), stored in the romanToNum object, matter?

    • @N1rOx
      @N1rOx Před 7 měsíci

      Yes, because the for in loop will only move in one direction, so the order the roman numerals need to be in must match the way the arabic numerals convert to roman numerals.

  • @CameronChardukian
    @CameronChardukian Před 5 lety

    Haha just like FunFunFunction. If your brain hurts, it's a good thing -- It means you're learning! Seriously though, thanks for creating this video for us. You explained everything very well!

  • @ifteyh.i.raiyan7277
    @ifteyh.i.raiyan7277 Před 2 lety

    make more videos brother

  • @amguruprasath8037
    @amguruprasath8037 Před 5 lety

    Here is a simpler solution with single for loop
    function convertToRoman(num) {
    var roman = {
    M: 1000,
    CM: 900,
    D: 500,
    CD: 400,
    C: 100,
    XC: 90,
    L: 50,
    XL: 40,
    X: 10,
    IX: 9,
    V: 5,
    IV: 4,
    I: 1
    };
    var romanNum = "";
    for(key in roman){
    var check = num>=roman[key];
    if(check){
    console.log(romanNum);
    romanNum += key;
    num-= roman[key];
    }
    }
    return romanNum
    }
    convertToRoman(150);

  • @adityachaudari4321
    @adityachaudari4321 Před 2 lety

    i watched all the tutorials but find really hard to solve any problem and need to see the solution in internet. Do other people also experience this, or just me?

  • @--Dipanshu--
    @--Dipanshu-- Před 3 lety

    noted. drink cold water when having cold, with that I can be a developer like him .

  • @ifolkstales7612
    @ifolkstales7612 Před 5 lety

    Please I run this same code in repl.it, but it gives me 'undefined', why?
    function convertToRoman(num){
    var romanToNum = {
    M:1000,
    CM: 900,
    D: 500,
    CD: 400,
    C: 100,
    XC: 90,
    L: 50,
    XL: 40,
    X: 10,
    IX: 9,
    V: 5,
    IV: 4,
    I: 1
    };
    var roman = "";
    for(var key in romanToNum){
    console.log(key);
    }
    }

  • @subhamagarwal1665
    @subhamagarwal1665 Před 3 lety

    1:24 thats what she said

  • @RuneSTEMEducation
    @RuneSTEMEducation Před 2 lety

    hi i dont know you will read tthis comments or not. anyway. I used your code as solution but it is saying wrong answer

  • @somnvm37
    @somnvm37 Před 3 lety

    I still have problems with roman numerals.
    Hoow do you know that XC is not just 10+100, but 100-10?
    Why CC is 100+1000, and not 100-100.

  • @samoh6084
    @samoh6084 Před 3 lety

    Superb explanation. Kind of distracting though not gonna like I feel like I always need to take some benzodiazepines after watching your videos.

  • @mickpick4678
    @mickpick4678 Před rokem

    "hard and long" lol

  • @AhmedIbrahim-fi2so
    @AhmedIbrahim-fi2so Před 3 lety

    worst challengs in the world ! 😂😂😂 ! the problem is not js .. its the problem 😑

  • @dineshrajan6048
    @dineshrajan6048 Před 6 měsíci

    Thank you!