Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
brings tears to the eyes. quite lovely!
from javascript.info
"
But if there is a return statement, then the rule is simple:
If return is called with an object, then the object is returned instead of this.
If return is called with a primitive, it’s ignored.
In other words, return with an object returns that object, in all other cases this is returned.
"
I think this is the most clever solution I've seen.
Not sure, but I think beceause as soon as you call the NameMe function you will get the object back that is returned inside NameMe. So it will only get you the name. But if you return nothing you will get "this", so the NameMe object itself.
A perfect solution
This is one of my favorite iterations - lead me down a rabbit hole on MDN looking for new ways to refactor some old code.
Love the reset after output!! So clever.
omg
me too!
This is bit over my head. I only heard about phantom types, never used them and know little about it, will do some resarch. But this looks greate tbh.
for sure and thank you! It is slower and doesn't have elm-format which is half the delight for me tbh. But it can be nice to write code that's snack sized on here so I can't stay away.
I ended up making a safe version using phantom types and the next move would be to try to see if the phantom builder pattern can apply (I've never used it so maybe this is actually already it!)
https://www.codewars.com/kata/reviews/5e513d6d6971ed00018f144b/groups/6393ce91c7247d00017b1a1a
Make sense, I was just very impresedd by your little 'expand' abstraction and then you ended up in such a clean pipline. I would do more here on codewars but the whole thing is so slow, compared to Ellie for example.
aww TY bud!! im gonna redo this with some wrapped up types because naked Ints for this doesn't make me happy
wow, lovely!
This comment is hidden because it contains spoiler information about the solution
Loading more items...