scrimba
Learn Basic JavaScript
Return Early Pattern for Functions
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Return Early Pattern for Functions
AboutCommentsNotes
Return Early Pattern for Functions
Expand for more info
index.js
run
preview
console
// Setup
function abTest(a, b) {
// Only change code below this line



// Only change code above this line

return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}

// Change values below to test your code
abTest(2,2);
Console
false
,
index.html
-1:13