Functions

Arrow Function Returns

Arrow Function Returns

An arrow function with an expression body returns that expression automatically. An arrow function with braces has a block body, so it needs an explicit return.

Your task: Fix formatDollars so callers receive the dollar amount string.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Arrow Function Returns

An arrow function with an expression body returns that expression automatically. An arrow function with braces has a block body, so it needs an explicit return.

Your task: Fix formatDollars so callers receive the dollar amount string.

Free with a JS Exercises account

Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.

By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.

Console

Run code to see output.