DEV Community

Discussion on: Semicolon Rules in JavaScript are weird...

Collapse
 
dschu profile image
dschu • Edited

Hey Dean,

great article. :)

Since you seem to like clean, readable code, you may want to put your expression in parantheses, like this:

function addOneUndefined(x) {
    return (
        x + 1
    );
}

function cubicBezier(x, u0, u1, u2, u3) {
    return (
        u0 * (1 - x) * (1 - x) * (1 - x) +
        u1 * (1 - x) * (1 - x) * x +
        u2 * (1 - x) * x * x +
        u3 * x * x * x
    );
}
Collapse
 
dean profile image
dean

Oh, I like this! Thank you :)