JavaScript Node.js Basics Introduction to Node.js The Console

console.log("Andrew");

console.log("Andrew"); console.error("Something bad has occurred"); console.dir({favouriteLanguage: "JavaScript", age: 33, children: 3 })

app.js
console.log("Andrew");
console.error("Something bad has occurred");
console.dir({favouriteLanguage: "JavaScript", age: 33, children: 3 })

1 Answer

andren
andren
28,336 Points

The challenge did not want you to replace the existing variables in the workspace with the various functions. But instead to use the variables with those functions. Like this:

const name = "Andrew";
const details = { favouriteLanguage: "JavaScript", age: 33, children: 3 } 
const errorMessage = "Something bad has occurred";

console.log(name);
console.dir(details)
console.error(errorMessage);