Problem Marker

const total = items.reduce(sum, i) => sum + i.price);
Expected 2 arguments, but got 1.
About this piece

Problem Marker

Code line with a rose wavy underline on the offending token above an alert card with the message.

Usage

The import and the props worth knowing about, in one place.

import { Editor14 } from "@/components/beste/piece/editor14";

<Editor14
  prefix="const total = items."
  problem="reduce"
  suffix="(sum, i) => sum + i.price);"
  message="Expected 2 arguments, but got 1."
  bordered={false}
/>

More Editor pieces

View all Editor
const name = user.prfile.name;Property 'prfile' does not exist on type 'User'.
The implmentation ships on Friday.
  • implementation
  • implements
  • implemented
return greet(name);
Hania
const greet = (name: string) => `Hello, ${name}!`;
const msg = greet("Beste");
function greet(name: string): string

Returns a localized greeting for the given name.

1function·greet(name)·{
2→return·`Hello,·${name}!`;
3}