-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vydělení samostatného kurzu JavaScript 2
- Loading branch information
Showing
21 changed files
with
81 additions
and
41 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
## Cvičení: Metody `forEach` a `map` | ||
|
||
::exc[cvlekce/pocitani-ovecek] | ||
::exc[cvlekce/map-jednohubky] | ||
::exc[cvlekce/nezaplacene-objednavky] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
## Cvičení: Práce s poli | ||
|
||
::exc[cvlekce/pole-v-divadle] | ||
::exc[cvlekce/sachovnice] | ||
::exc[cvlekce/indexy] | ||
::exc[cvlekce/pocitani-ovecek] |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: Práce s indexy | ||
demand: 3 | ||
lead: Vyzkoušejte si jak přistupovat k prvkům v poli pomocí indexů. | ||
solutionAccess: protected | ||
--- | ||
|
||
Cvičení provádějte ve vašem JavaScript souboru. | ||
|
||
1. Napište funkci `first`, která jako svůj parametr přijme pole a vrátí první prvek tohoto pole. Pokud pole bude prázdné, funkce vrátí `undefined`. Funkci otestujte s několika různými poli. Například: | ||
|
||
```js | ||
first([3, 2, 1]); // ⟶ 3 | ||
first([]); // ⟶ undefined | ||
``` | ||
1. Napište funkci `last`, která jako svůj parametr přijme pole a vrátí poslední prvek tohoto pole. Pokud pole bude prázdné, funkce vrátí `undefined`. Funkci otestujte s několika různými poli. Například: | ||
|
||
```js | ||
last([3, 2, 1]); // ⟶ 1 | ||
last([]); // ⟶ undefined | ||
``` | ||
1. Napište funkci `middle`, která jako svůj parametr přijme pole a vrátí prvek uprostřed tohoto pole. Pokud pole bude prázdné, funkce vrátí `undefined`. Pokud pole bude obsahovat sudý počet prvků, vrátí funkce prvek vlevo od středu. Funkci otestujte s několika různými poli. Například: | ||
|
||
```js | ||
middle([3, 2, 1]); // ⟶ 2 | ||
middle([3, 2, 1, 0]); // ⟶ 2 | ||
middle([]); // ⟶ undefined | ||
``` | ||
1. Napište funkci `middleMean`, která jako svůj parametr přijme pole a vrátí prvek uprostřed tohoto pole. Pokud pole bude prázdné, funkce vrátí `undefined`. Pokud pole bude obsahovat sudý počet prvků, vrátí funkce průměr dvou prvků uprostřed. Funkci otestujte s několika různými poli. Například: | ||
|
||
```js | ||
middleMean([3, 2, 1]); // ⟶ 2 | ||
middleMean([3, 2, 1, 0]); // ⟶ 1.5 | ||
middleMean([]); // ⟶ undefined | ||
``` | ||
1. Napište funkci `insert`, která jako první parametr přijme pole a jako druhý parametr nějakou hodnotu. Funkce zkontroluje, zda pole již obsahuje tuto hodnotu. Pokud ano, vrátí `false`. Pokud ne, vloží hodnotu na konec pole a vrátí `true`. Funkci otestujte s několika různými poli. Například: | ||
|
||
```js | ||
insert([3, 2, 1], 4); // ⟶ true | ||
insert([3, 2, 1], 3); // ⟶ false | ||
``` |
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
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
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
title: JavaScript 2 | ||
lead: Dlouhodobý kurz JavaScript 2 pro vývoj webových aplikací | ||
image: assets/javascript.svg | ||
lessons: | ||
- ../daweb/js2/opakovani | ||
- ../daweb/zaklady-gitu/spoluprace | ||
- ../daweb/js2/organizace-bundle | ||
- ../daweb/js2/sablony-komponenty | ||
- ../daweb/js2/server-komunikace | ||
- ../daweb/js2/podminene-zobrazeni | ||
- ../daweb/js2/seznamy | ||
- ../daweb/js2/posilani-dat | ||
- ../daweb/js2/api-parametry | ||
- ../daweb/js2/crud | ||
- ../daweb/js2/cafe-lora-1 | ||
- ../daweb/js2/cafe-lora-2 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.