Hello, I am really new to JavaScript and was just wondering why this code throws an error.
And also what can I do to make it so when I put “raw” after robot.material I get “Iron” and if I put “fuel” I get “2 L”
const robot = {
fuel: “2 L”,
raw: “Iron”,
material(prop) {
return this.prop
}
}
console.log(robot.material(raw))