This file contains hidden or 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
| setInterval(() => { | |
| var mySaiyan = document.getElementById("saiyan"); | |
| if (typeof(mySaiyan) != 'undefined' && mySaiyan != null) { | |
| //Do some heavy load actions | |
| console.log("My saiyan exists!"); | |
| } | |
| }, 1000); |
This file contains hidden or 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
| const attackWarning = " is attacking you!"; | |
| function attack(attacker) { | |
| const attackResult = "You dead man"; | |
| console.log(attacker + attackWarning ); | |
| console.log(attackResult); | |
| } | |
| attack("Goku"); |
This file contains hidden or 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
| function getAttackName() { | |
| return "Kamehameha"; | |
| } | |
| function attack(attacker) { | |
| var attackName = getAttackName(); | |
| console.log(attacker + " throws " + attackName); | |
| } | |
| attack("Goku"); |
This file contains hidden or 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
| function attack(attacker) { | |
| function getAttackName() { | |
| return "Kamehameha"; | |
| } | |
| var attackName = getAttackName(); | |
| console.log(attacker + " throws " + attackName); | |
| } | |
| attack("Goku"); |
OlderNewer