Advertisement
728x90
Below are the list of placeholders available from console object,
1. %o — It takes an object,
2. %s — It takes a string,
3. %d — It is used for a decimal or integer
These placeholders can be represented in the console.log as below
javascript
1const user = { name: "John", id: 1, city: "Delhi" };
2
3console.log(
4 "Hello %s, your details %o are available in the object form",
5 "John",
6 user
7); // Hello John, your details {name: "John", id: 1, city: "Delhi"} are available in objectAdvertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 29
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
371of476