Easy javascript

Functional component greeting

Problem

Create a React component that renders Hello, {name}.

Hints
  • return JSX with interpolated name

Your practice code

Ready — edit the code above and click Run.

Solution

function Greeting({ name }) {
  return `Hello, ${name}`;
}
console.log(Greeting({ name: "Sandeep" }));

Try solving on your own first, then reveal the official answer.

Explanation

Functional components receive props and return JSX. Interviewers expect clarity on props destructuring.

Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details