I have this JavaScript code:
console.log(obj);// [query: "wordOfTheDay"]
console.log(note + " : " + obj ); // obj does not show up
I want to make "obj" display in the same string as "note" no matter the type it come in as.
For example:
console.log("text sample : " + obj ); // text sample : [query: "wordOfTheDay"]
Thank you!
console.logtakes as many parms as you want to give it and logs them in the same log line with their types preserved. Just do:console.log('text sample:', obj);