Likes Counter
JavaScript
20 pts
Likes Counter
A video in Asmara went viral. The starter has let likes = BigInt(Number.MAX_SAFE_INTEGER);
- Add 10 more likes with
+=and printlikes. - Create
groups: how many full groups of 1000 likes (/). Print it. - Create
rest: the likes left over (%). Print it. - Create
small:restconverted to a normal number. Printsmall + 0.5. - Print the type of
small.
Expected output:
9007199254741001n 9007199254741n 1n 1.5 number
Checklist
- Add 10 likes with
+=. - Create
groupsandrestwith BigInt maths. - Convert to a normal number in
small. - The five lines match.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
