JS
challenger
Home
Intermediate JavaScript
classes
Add a Setter to Update a Property
Add a Setter to Update a Property
The class
Temperature
stores a
celsius
value. Add a setter
fahrenheit
that converts the assigned value to celsius and stores it in
this.celsius
. Use the formula
(f - 32) * 5 / 9
.
Premium
reset
function greet(name) { return `Hello, ${name}!`; } console.log(greet("Erik"));
JavaScript
Run Code
Console