@B1ts I know this is an old post but still wanted to say thank you so much for your explanation! It was super helpful, especially with the log = console.log!
there is actually no need to save into variables the functions in our answers to these exercises, as we're not asked to then use them as parameters in higher order functions, so we can use a function expression, rather than a function declaration (plus, especially with the concise arrow syntax, we can use functions diretly as argumemts in other functions, or define and call them at the same time as an IIFE, eg. ((n)=> {console.log(n=5);}10); that logs 15)
It's not faster, if you run the code, you'll notice that the time varies a lot between one and the other, sometimes one is faster and sometimes the other, and endswith is written in C for performance.
@B1ts I know this is an old post but still wanted to say thank you so much for your explanation! It was super helpful, especially with the
log = console.log
!This is clean!
I'm going to learn it. Thank you!
there is always a easy way.
Nice! The ternary expression makes life way much easier.
there is actually no need to save into variables the functions in our answers to these exercises, as we're not asked to then use them as parameters in higher order functions, so we can use a function expression, rather than a function declaration (plus, especially with the concise arrow syntax, we can use functions diretly as argumemts in other functions, or define and call them at the same time as an IIFE, eg. ((n)=> {console.log(n=5);}10); that logs 15)
Good job here !
love the simplicity
very clean man
i did same.
this is what I tried to do!
clean code
I used a really long winded recursion implementation and I feel so stupid looking at this
nice one
It's not faster, if you run the code, you'll notice that the time varies a lot between one and the other, sometimes one is faster and sometimes the other, and endswith is written in C for performance.
Loading more items...