JS
challenger
Home
Intermediate JavaScript
classes
Method Using `this`
Method Using `this`
Add a method
describe
to the class
Product
. It should return a string in the form
"name costs price"
using the instance's own
name
and
price
properties.
Premium
reset
function greet(name) { return `Hello, ${name}!`; } console.log(greet("Erik"));
JavaScript
Run Code
Console