.flex-item:nth-child(1) {
flex:1;
}
The above flex
property is a shorthand of the following properties:.flex-item:nth-child(2) {
flex-grow:1;
flex-shrink:1;
flex-basis:0;
}
In the example, the first two elements have the same effectnumber
, issue_date
SELECT
document_details,
JSON_EXTRACT(document_details, '$.number'),
JSON_EXTRACT(document_details, '$.issue_date'),
JSON_UNQUOTE(JSON_EXTRACT(document_details, '$.issue_date'))
FROM students
Note: We can use JSON_UNQUOTE()
function to remove quotes around JSON string valuesJSON_OBJECT
returns JSON string.
It takes comma separated key / value pairs as parametersINSERT INTO students (
first_name,
last_name,
gender,
points,
document_details
)
VALUES (
'Beka',
'Gelashvili',
'1',
'82',
JSON_OBJECT('issue_date', "2020-05-25", "expire_date", "2030-05-18", "number", 5)
)
JSON_ARRAY
takes parameters as array members and returns JSON string as arraySELECT
JSON_ARRAY("2020-05-25", "2030-05-18", "number", 5)
JSON_TYPE
takes JSON content and returns its typeSELECT
JSON_TYPE('{}'), -- returns OBJECT
JSON_TYPE('[]'), -- returns ARRAY
JSON_TYPE(NULL) -- returns NULL
JSON_PRETTY
prettifies JSON contentSELECT
JSON_PRETTY(document_details)
FROM students
Note: MariaDB
does not include JSON_PRETTY
functiongreen
background colordocument.body.style.backgroundColor = 'green';
Sets display
property to inline-block
for the element with id element_id
document.getElementById('element_id').style.display = 'inline-block';
cat
combines attributes and behaviors of a cat in the following objectlet cat = {
age: 4,
name: 'Bella',
meow() {
console.log('Meowwww');
}
}
Instead of the object, we would have separated function and variables, which is not organized waylet catName = 'Bella';
let catAge = 4;
function meow() {
console.log('Meowwww');
}
boyfriend
inside cat
objectlet cat = {
name: 'Lucy',
age: 4,
meow() {
console.log('Meowwww');
},
boyfriend: {
name: 'Jack',
age: 5,
favoriteColors: ['Green', 'Yellow'],
meow() {
console.log('Meeoowwwwwwwwwwww');
},
}
}
Accessing nested object's attributes and methods:console.log(cat.boyfriend.name); // Jack
cat.boyfriend.meow(); // Meeoowwwwwwwwwwww