Right I see, I didn’t check the challenge. Both of your functions should actually fail.
It wants you to return the value of weight, which is a number. When you use a template literal, you’re converting the Number 15 into a String '15', that’s why the tests fail.
Well, you did learn something, string literals are in fact (surprise, surprise) strings. As a rule of thumb, you should never change the data type unless you need to. If the return was used for some math you might end up with unexpected results (like string concatenation).
function Bird(weight) {
let _weight = weight;
this.getWeight = () => { return `${_weight}` }
}
let ducky = new Bird(15);
console.log(typeof ducky.getWeight()) // string
console.log(15 + ducky.getWeight()) // 1515
The test has a strict equals check so the type must match and the regex used won’t match on your code either. Experimenting is fine, just know a lot of challenges might break if you provide them with unexpected code.