This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1: object | |
#2: 57 | |
#3: 10.5 | |
#4: undefined | |
#5: John | |
#6: 542 | |
#7: 113 | |
#8: 3 | |
#9: 64 | |
#10: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
var x = y / 10; | |
} catch(error) { | |
console.log(error); | |
} | |
// Console: ReferenceError: y is not defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Room | |
{ | |
private $color = 'white'; | |
private $size = 'xl'; | |
public function setColor(string $color): void | |
{ | |
$this->color = $color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Sun | |
{ | |
// ... | |
private function __sleep() {} | |
private function __wakeup() {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.name = 'شایان شایان پرور'; | |
function greeting() { | |
console.log('سلام آقای ' + window.name); | |
} | |
greeting(); // سلام آقای شایان شایان پرور | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let name1 = "John"; | |
let name2 = name1; | |
console.log(name1); // John | |
console.log(name2); // John | |
name1 = "Paolo"; | |
console.log(name1); // Paolo | |
console.log(name2); // John |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let house1 = { | |
color: 'green' | |
} | |
let house2 = house1; | |
console.log(house1.color); // green | |
console.log(house2.color); // green | |
house1.color = "yellow" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Colors {Red, Green, Blue}; | |
console.log(typeof Colors); // object | |
console.log(Colors); | |
/* | |
{ | |
'0': 'Red', | |
'1': 'Green', | |
'2': 'Blue', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These two lines: | |
console.log(y); // undefined | |
y = "Street"; | |
// are interpreted as: | |
var y; | |
console.log(y); // undefined | |
y = "Street"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let person = { | |
name: 'Bastian', | |
lastname: 'Schweinsteiger' | |
}; | |
person = JSON.stringify(person); | |
localStorage.setItem('user', person); | |
OlderNewer