18
19function simpleLightbox(properties = {}, customCSS = {}, $elements = []) {
20 if(properties["class"] === undefined)
21 properties["class"] = "lightbox"; 22 let defaultCSS = {
23 "display": "inline-block",
24 "top": "50%",
17}
18
19function simpleLightbox(properties = {}, customCSS = {}, $elements = []) {
20 if(properties["class"] === undefined) 21 properties["class"] = "lightbox";
22 let defaultCSS = {
23 "display": "inline-block",
In JavaScript, there are two ways to access the properties of an object:
(object.property)
( Recommended )(object["property"])
( Bad Practice )The dot notation is preferred because it is easier to read, less verbose, and works better with aggressive JavaScript minimizers.
const x = object["property"];
const x = object.property;
x = object[y];