Содержание
- 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)










Подростковая культура
Кабан или дикая свинья
Презентация на тему Словарная работа со смешариками 2 класс
ROADEXВосемь лет успеха!
Приложение «Пятнашки в городе» Играй и пятнай! Руководитель проекта: Руслан Захаров e-mail:
Информационная деятельность человека
БЮДЖЕТ И БЮДЖЕТНАЯ СИСТЕМА
Синектика — коллективный творческий метод от Уильяма Гордона
Банковское сопровождение проектов. Перечень обосновывающих документов
Вовлечение общественности в процесс экологической оценки
Презентация на тему Облик Земли постоянно меняется
Презентация на тему Проецирование. Виды проецирования
Урок преподавателя химии Смирновой Л.Н.. «Урок это солнце, вокруг которого, как планеты, вращаются все формы учебных занятий» Н.М. Ве
Окислительные свойства концентрированной серной и азотной кислот
Начальный замер. Картинки
СИСТЕМЫ ВОДЯНОГО ОТОПЛЕНИЯ
Информационные технологии в психологии.Введение. Цель. Назначение.
Open Source решения
Hallowe'en
Книга по продукту студии Анны Ключко
Гендина Н. И., директор НИИ информационных технологий социальной сферы КемГУКИ, доктор пед. наук, профессор
Игра–путешествие по сказкам Г. Х. Андерсена
Объединенная Хоккейная Лига
Электромагнитное поле
МОЯ БУДУЩАЯ ПРОФЕССИЯ
Урок мужества Никто не забыт, ничто не забыто
II. Ранние греческие философы 1. «Осевое время» Карла Ясперса в период 800-200 гг. до Р. Х. в развитии независимых друг от друга пяти цен
Цель семинара