I am having an issue when trying to console.log a template literal. As you can see below, I have a simple object of samsung, which has a method where it turns on and prints the template literal to the console.
let samsung = {
model: "S21",
camera: "48px",
processor: "Snapdragon888",
turnOn: function(model, camera, processor) {
console.log(
`I have turned on! I am the ${model}, I have a ${camera} camera and a ${processor} processor`
);
},
};
console.log(samsung.turnOn());
I've tried it lots of different ways, using arrow functions, using the "this" operator, adding/removing parameters of the function, putting in "Samsung" instead of "this" etc. But it prints out the following no matter what: I have turned on! I am the ${model}, I have a ${camera} camera and a ${processor} processor