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
| var channels = ["A", "B", "C"]; | |
| channels.forEach (function (channel) { | |
| channels.push ("D"); // this item will be ignored | |
| console.log (channel); | |
| }) | |
| console.log (channels); | |
| // ['A', 'B', 'C', 'D', 'D', 'D'] |
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
| var channels = ["A", "B", "C"]; | |
| channels.forEach(function(channel) { | |
| channels.push("D"); // this item will be ignored | |
| console.log(channel); | |
| }) |
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
| var names = ['adam', 'brian', 'charles']; | |
| function printsName (name) { | |
| console.log (name); | |
| } | |
| names.forEach (printName); |
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
| var names = ['adam', 'brian', 'charles']; | |
| names.forEach (function (name) { | |
| console.log (name); | |
| }); | |
| // adam, brian, charles |
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
| var names = ['adam', 'brian', 'charles']; | |
| for (var i = 0; i <names.length; i ++) { | |
| console.log (names [i]); | |
| } | |
| // adam, brian, charles |
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
| var fruits = ['pineapple', 'apple', 'grape']; | |
| for (var i = 0; i <fruits.length; i ++) { | |
| // iteration body | |
| } |
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
| press ctrl+ c | |
| > lsof -i :8000 | |
| to check if the port is busy or not if any process is listening to the port 8000 it will be displayed with port id | |
| > sudo kill -9 [PID] | |
| kill the process that listen to that port id | |
| run lsof agin |
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
| <?php | |
| ini_set('display_errors', 1); | |
| ini_set('display_startup_errors', 1); | |
| error_reporting(E_ALL); | |
| class Father { | |
| // Property | |
| public $lastName; |
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
| <?php | |
| ini_set('display_errors', 1); | |
| ini_set('display_startup_errors', 1); | |
| error_reporting(E_ALL); | |
| class Person { | |
| protected $name = 'No Name'; | |
| private $birthYear = 'No Year'; |
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
| <?php | |
| ini_set('display_errors', 1); | |
| ini_set('display_startup_errors', 1); | |
| error_reporting(E_ALL); | |
| class BankAccount { | |
| private $agency; | |
| private $account; |