Why the console.log output in quotes?



Hallo all,

even tough my code is accepted an all ok, I wonder why the quotes are also printed, tried several ways to remove but quite found one…

let person = {
  name: 'Tyron',
  age: 40,
  weekendAlarm: 'No alarms needed',
  weekAlarm: 'Alarm set to 7AM',
  sayHello: () => {
  return 'Hello, there!'
person.hobbies = ['golf', 'cycling'];
person.hobbies = ['golf'];
var day = 'Sunday'
let alarm
if (day === 'Saturday' || day === 'Sunday') {
   alarm = 'weekendAlarm';
} else {alarm = 'weekAlarm'};


If you print the list, it shows the apostrophes. If you don’t want the apostrophes, you will have to print the items from the array, one way or the other


print from array, which changes I should make ?

others print out normally.


to get elements from array, we could use indexes. Or if you have multiple elements you would like to print, you can use a loop, or a method like .join() which joins array into string


thanks for help, will need to go through previous lessons as stuck here and seems cant solve it…


that is possible, if you include your code and exercise + error message i can also help you, but sometimes its good to rethink everything you did so far.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.