Содержание
- 2. Agenda Program flow control - conditions - loops - switch statement Collections - array - hash
- 3. Program Flow Control
- 4. Program flow Operators in a program processed in linear order: from top to bottom and from
- 5. Conditions: if-else Most of algorithms have situation when next step related of some conditions depended on
- 6. Conditions: if-else Example: function discount (type) { if (type === “silver”) { price *= 0.9; }
- 7. Conditions: ?: Sometimes if-else too bulky. If we need to initialize a variable modifying it by
- 8. Conditions: ?: function discount (type) { if (type === “silver”) { price *= 0.9; } if
- 9. Loops: for Loops are used when algorithm requires repeating of statements. First of them: for -
- 10. Loops: while and do-while Two others types of loops: while and do-while while (condition) { body
- 11. Loops: examples Example 1: for (var i = 0; i console.log(“Iteration # %d”, i + 1);
- 12. Which type of loop to use? It may be not so simple to decide which type
- 13. Loops: break and continue There are two keywords for loops control : break – aborts loop
- 14. Switch Switch statement allows to select one of many blocks of code to be executed. If
- 15. Switch Example: This switch looks for the word equivalent for a mark in the 5-point system
- 16. Collections
- 17. Collections Collection is a set of variables grouped under common name. Usually elements of collections are
- 18. Arrays
- 19. Array: creation There are two ways to create an array: var name = [ ]; //
- 20. Array: processing Usage of arrays: var array = [] // declaration of empty array var array
- 21. Array: processing In the sample below we output all elements of the array to the console:
- 22. Array: features Arrays in JavaScript differ from arrays in classical languages. Arrays in JS are instances
- 23. Array: length calculation Let's discuss length calculation. It’s a virtual property. Arrays don't review own elements.
- 24. Array: useful methods Some useful methods of array: array.push(value) – add element to the end of
- 25. Array: forEach Not so long ago array received very comfortable method forEach. This method circulates around
- 26. Hash Table
- 27. Hash Table: creation Sometimes we need an Array with string indexes (keys). There is a special
- 28. Hash Table: creation We can create hash and initialize it at the same time. For this
- 29. Hash Table: usage Usage of hash tables is very similar to arrays: hash[“good”] = 4; //
- 30. Array vs Hash Use Array for collections with digital indexes. Use Hash if you want use
- 32. Скачать презентацию


















![Array: processing Usage of arrays: var array = [] // declaration of](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/377515/slide-19.jpg)










Наши предки – славяне (3 класс)
Акционное предложение Biosphere professional
«Профессиональный выбор – один из главных выборов в жизненном самоопределении личности»
Общественное участие в бюджетном процессе и городских целевых программах
Екатеринбургский музей изобразительных искусств
Стресс. Как превратить стресс в друга?
Subjects of IR
Институт Коммерческого Менеджмента (Великобритания)www.icm.ac.uk
Круглый стол:«СОЦИАЛЬНЫЕ МЕДИА»скромный опыт издательства«Манн, Иванов и Фербер»
Сообщение по биологии на тему «Утконос» Ученика 7В класса школы №5 Бережняка Никиты
МЕЖДУНАРОДНЫЙ ЦЕНТР ПО ИНФОРМАТИКЕ И ЭЛЕКТРОНИКЕ (ИнтерЭВМ) www.mifp.ru www.inevm.ru Технологии образовательных ресурсовICIE Технологическое
Организация и ведение лесопаркового хозяйства
Презентация на тему Физминутка для глаз
Электронное участие граждан: региональный уровень (на примере Волгоградской области)
Правила линейной и воздушной перспективы
Павел Кузнецов
Алфавит в звуках и картинках
Животный мир новой зеландии
Крахмал,мед,сахар
Физика и Великая отечественная война
В доме восемь дробь один У заставы Ильича Жил высокий гражданин, По прозванью … По фамилии … И по имени Степан, Из районных великан
Физические свойства
Предъявление результатов мониторинга.Адресаты оценки индивидуального прогресса и их целевые установки: администрация, педагоги,
17 век. Рембрандт Харменс ван Рейн (1606 - 1669)
Сверхпроводниковые технологии и проблемы использования отходов и вторичных ресурсов
День снятия блокады города Ленинграда 1944 год
Алгебра логики
Реализация проектной и исследовательской деятельности в контексте ФГОС