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 | |
| namespace Database\Seeders; | |
| use Illuminate\Database\Seeder; | |
| use Illuminate\Support\Facades\DB; | |
| use Illuminate\Database\Console\Seeds\WithoutModelEvents; | |
| class SalarioSeeder extends Seeder | |
| { |
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
| // 5.3 Everything | |
| //every using a loop | |
| function every(array, test) { | |
| for (let element of array) { | |
| if (test(element) === false) { | |
| return false; | |
| } | |
| } | |
| return true; | |
| } |
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
| // 5.1 Flattening | |
| let arrays = [[1, 2, 3], [4, 5], [6]]; | |
| console.log(arrays.reduce((array1, array2) => array1.concat(array2))); | |
| // → [1, 2, 3, 4, 5, 6] |