Results: 1022
Date type is not allowed in JSON. If we need to have a date, we have to include it as a string and then we can convert it back to date object later
var text = '{"name":"John", "birth":"1986-12-14", "city":"New York"}';

var obj = JSON.parse(text);
obj.birth = new Date(obj.birth);

document.write(obj.name + ", " + obj.birth)
Also we can use the second parameter of the
JSON.parse()
function, called
reviver
that checks each property, before returning the value
var text = '{ "name":"John", "birth":"1986-12-14", "city":"New York"}';

var obj = JSON.parse(text, function (key, value) {
  if (key == "birth") {
    return new Date(value);
  } else {
    return value;
  }
});

document.write(obj.name + ", " + obj.birth)
Solution to the problem was to add labels for the inputs but hidden by
CSS
/* Fix to pass Lighthouse: */
.label-hidden {
    position: absolute;
    height: 1px;
    width: 1px;
    clip: rect(1px,1px,1px,1px);
    border: 0;
    overflow: hidden
}
Another solution to the problem:
/* Fix to pass Lighthouse: */
label-hidden { 
    position: absolute; 
    top:-1000px; 
    left:-1000px; 
}
The password
123
will be encrypted and then decrypted back with
AES-128-ECB
encryption algorithm. Encrypts the text using the secret key
sec key
function encrypt_text($text, $secret_key)
{
    return openssl_encrypt($text,"AES-128-ECB", $secret_key);
}
Decrypts encrypted text (first parameter) using the secret key (second parameter)
function decrypt_text($encrypted_string, $secret_key)
{
    return openssl_decrypt($encrypted_string,"AES-128-ECB", $secret_key);
}
Calls the above two functions to perform encryption and decryption
// Secret key, that is used to encrypt and decrypt the 
$text
content $secret = 'sec key'; // the text that we want to encryption and decryption $text = '123'; $password_encrypted = encrypt_text($text, $secret); $password_decrypted = decrypt_text($password_encrypted, $secret); echo 'Encrypted text: ' . $password_encrypted . '<br>'; echo 'Decrypted password: ' . $password_decrypted;
HTTP vs HTTPS
HTTP
stands for Hypertext Transfer Protocol. The standard (default) port for
HTTP
connection is
80
, but other port can also be used HTTP does not have any
security
...
HTTPS
stands for Hypertext Transfer Protocol Secure. HTTPS has a secure transfer. The standard port in
HTTPS
to transfer the information is
443
HTTPS protocol uses HTTP on connection encrypted by SSL or TLS (therefore it's secure)
margin & padding properties work only horizontally on inline elements (like
span
,
a
). Solution -
display: inline-block;
or
display: block;
multiple
attribute enables us to select several options at the same time.
size
attribute determines select tag height in options
Console notification types
List of all types of console notifications
console.log('console log');
console.info('console info');
console.warn('console warn');
console.error('console error');
Difference between REPLACE and ON DUPLICATE KEY UPDATE
REPLACE
statement updates the listed columns if primary key (one of the listed columns) already exists. Otherwise inserts as a new record
REPLACE INTO students (id, first_name, points)
VALUES (41, 'ილიკო', 147)
Similar to the
REPLACE INTO
statement is
ON DUPLICATE KEY
. The only difference is that on duplicate key it updates only the listed columns but omitted values stays the same
INSERT INTO students (id, first_name, points) 
VALUES (41, 'გიორგი', 149) 

ON DUPLICATE KEY 

UPDATE first_name = 'გიორგი', points = 123
Note 1
: If primary key is not listed, it will insert the record, but if the primary key is one of the listed columns, it will update the specified row that matches the primary key.
Note 2
: If the primary key exists, all the other omitted columns will get the default values after updating the record.
Let variable scope CODE
Variable described using keyword
let
uses block scope
let myNumber = 1

function callMePlease() {
  let myNumber = 2
  
  if (1 == 1) {
    let myNumber = 3    
    document.write('My number is: ' + myNumber + '</br>')
  }  
  document.write('My number is: ' + myNumber + '</br>')
}

document.write('My number is: ' + myNumber + '</br>')

callMePlease()
element.
childNodes
returns an array of an element's child nodes. element.
firstChild
returns the first child node of an element. element.
lastChild
returns the last child node of an element. element.
hasChildNodes
returns true if an element has any child nodes, otherwise false. element.
nextSibling
returns the next node at the same tree level. element.
previousSibling
returns the previous node at the same tree level. element.
parentNode
returns the parent node of an element.
Results: 1022