I hope to make more soon. Definitely checkout the code katas series for similar problem solving videos: ua-cam.com/play/PLM_i0obccy3sZGzZdpEtxPcR1iPIV0taQ.html
@@CodingGarden yeah i saw but i love this way new series and this is awesome i love your solving style and everyone should understand what are you doing i m waiting for videos
Wow! Only 21 comments in 12 months. Okay, so I wanted to watch this video just for fun, but I don't know JS well. I do code in other languages, and one of the things that I always try to do is keep my code readable. By that I mean: if ANYONE were to sit there & read my code, no matter what their skill level, then they should be able to follow along. The reason I am commenting here is that I was easily able to follow this beginners' JS example, UNTIL we got to the Array.with part ... looking at that code just baffles me, and although I think I understand it, why American2050 would we want or need to complicate things by doing it this way? Also, if the function STARTS with return, then why is there ANOTHER return at the END of the function?
The last solution is a more functional approach. The callback function gets called for every value up to n. The return value of the function will be the resulting value at that index in the new array. The function passed to Array.from is essentially a map function. You can read more about it here: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#mapfn It is very similar to array map: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
@MichaelMossmanNZ I think technically speaking, FizzBuzz is old for most programmers. Hotcake Pancake is technically the same thing. It is still easy, but just a different approach.
@MichaelMossmanNZ ok have fun. Idk if you can find it, though, because idk where our prof gets that. Though I can provide some help. If I remember how the challenge goes.
I really like how some of the comments from the twitch chat were looking out for the beginners like myself. You guys rule.
You are killing it with these new segments.
I love how straightforward this video was
Thanks for showing several different solutions and showing the code optimization process!
Woooo, finally I can be here for the start of a series, lets goo.
How frequent will the videos be in this series? Really looking forward to it.
I like all these new series. Please continue :)
Amazing. Keep these coming!
Love these videos! And also how you are testing the waters on YT. Looking forward to the future change! lol
Man make more if this
I Fill in love with js
I'm golang guy
why you stop making these js algorithms videos these are awesome please continue this series and new persons should learn everything from you
I hope to make more soon. Definitely checkout the code katas series for similar problem solving videos: ua-cam.com/play/PLM_i0obccy3sZGzZdpEtxPcR1iPIV0taQ.html
@@CodingGarden yeah i saw but i love this way new series and this is awesome i love your solving style and everyone should understand what are you doing i m waiting for videos
So is this not in twitch
This was recorded live on twitch!
@@CodingGarden Thank you BOSS
Wow! Only 21 comments in 12 months. Okay, so I wanted to watch this video just for fun, but I don't know JS well. I do code in other languages, and one of the things that I always try to do is keep my code readable. By that I mean: if ANYONE were to sit there & read my code, no matter what their skill level, then they should be able to follow along. The reason I am commenting here is that I was easily able to follow this beginners' JS example, UNTIL we got to the Array.with part ... looking at that code just baffles me, and although I think I understand it, why American2050 would we want or need to complicate things by doing it this way? Also, if the function STARTS with return, then why is there ANOTHER return at the END of the function?
The last solution is a more functional approach. The callback function gets called for every value up to n. The return value of the function will be the resulting value at that index in the new array.
The function passed to Array.from is essentially a map function. You can read more about it here: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#mapfn
It is very similar to array map: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
Cool
Can you do one on styled React components? I suck at it.
We're still missing one more way/method.
Your explanation is okay, though.
FizzBuzz is old
I'm doing hotcake pancake
FizzBuzz might be old to YOU!
@MichaelMossmanNZ I think technically speaking, FizzBuzz is old for most programmers.
Hotcake Pancake is technically the same thing.
It is still easy, but just a different approach.
Thank you for your reply. I will check out Hotcake Pancake too =)
@MichaelMossmanNZ ok have fun. Idk if you can find it, though, because idk where our prof gets that.
Though I can provide some help. If I remember how the challenge goes.
const TRUE = x => y => x;
const FALSE = x => y => y;
const range = (start, stop) =>
Array.from({length: stop - start },(_,i) => i + start);
const isDivisible = dividend => divisor =>
[TRUE, ...Array(divisor - 1).fill(FALSE)][dividend % divisor];
const fizzBuzz = N => range(0,N).map(num => {
const isDivisibleBy = isDivisible(num);
const isDivisibleBy3 = isDivisibleBy(3);
const isDivisibleBy5 = isDivisibleBy(5);
return isDivisibleBy3(isDivisibleBy5('FIZZ BUZZ')('FIZZ'))(isDivisibleBy5('BUZZ')(num));
});
const answers = fizzBuzz(100);
console.log(answers);
One more way to solve