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.
the title attracted me
Resolved by your fork
Approved
fork adding sample and random tests to JS, + upgrading to Node 18 and chai assertions
(author is gone)
Resolved by description edit in saudiGuy fork
Approved 👍
python new test framework is required. updated in this fork
Author's python solution assume that arguments from diapason 84600 - 86399 (23 hours 30 minutes 00 seconds - 23 hours 59 minutes 59 seconds) must to return '0 days ago'
In JavaScript / Python, we are given a plain Number / int though, not an object
no sample tests in JavaScript
I used regex instead but the 0.5 it's more readable and simple, I need to wash my brain or something bc I usually don't see theese kind of solutions
Nice kata!
And technically that is more accurate because parseInt can cause some issues at very large or very small values.
Since the instructions say we do not need to worry about
null
orundefined
values, you can use the unary operator to coerce the number to an int -+number
and use a double-bitwise operator to chop any decimal values that may follow -~~number
examples from MDN:
Don't use parseInt
, use Math.truncYes for this Kata I guess the idia is not to use Math object.
But in practice use parseInt Math.trunc!
Loading more items...