I am curious why some variables are solid and some variables are half opacity. What is the difference between them? Both variations are available in the global scope.
It shows the available space where text can be expanded. You can see this dashed area after text which means it is area where text can be expanded.
The blue color is the element's "content size", i.e. the area which holds text and/or other elements within it. The green color is the element's padding, and the orange color is the element's margin.
You can easily find the HEX or RGB color code used on a particular web page, using the native option in Google Chrome. Right-click on the color, and click on Inspect. Most of the time, you will get the color code on the right-hand side with other CSS.
Paddington Green is a green space and conservation area in the City of Westminster located off Edgware Road and adjacent to the Westway. It is the oldest part of Paddington and became a separate conservation area in 1988, having previously formed part of Maida Vale conservation area.
If the property is shown dimmed that means it's not enumerable. So it won't show up in when you loop through the object's properties:
Take the location object as an example:
When enumerating the properties toString
, valueOf
and __proto__
don't show up:
var keys = []; for (var key in location) { keys.push(key) }; console.log(keys)
-> ["replace", "assign", "hash", "search", "pathname", "port", "hostname", "host",
"protocol", "origin", "href", "ancestorOrigins", "reload"]
You can use propertyIsEnumerable
to find out if the property will show up when you loop over the object:
location.propertyIsEnumerable("search")
// true
location.propertyIsEnumerable("toString")
// false
By default all properties of an object are enumerable:
But you can change that by using defineProperty
:
Object.defineProperty(post, "author", {
value: "John Doe",
enumerable: false
});
When you log that object to the console the author property appears in a slightly lighter shade of purple.
(It seems the shorthand version doesn't have support for this formatting feature, but we can force DevTools to use the longer version for a small object using the dir
function.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With