DEV Community

Discussion on: JavaScript assignments - 1

Collapse
 
raphael_haecker profile image
Raphael Häcker

Hi,

first of all, cool idea!

A small tip I have:

comparing things with === already returns a boolean, so you don't necessarily need the if-statement. You could do

return a === 100 || b === 100 || (a + b) === 100;

This can make the code a little more concise.

Collapse
 
mateja3m profile image
Milan Matejic

Thanks for advice, you're right.