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










Применение тестов на уроках математики
Презентация на тему Паукообразные
АККРЕДИТАЦИЯ – ИЮНЬ 2011 ГОДА
Основы изучения уравнений
Презентация на тему Сохранение и укрепление психологического здоровья детей посредством создания благоприятного микроклимата в
Мельникова Татьяна Алексеевна
Владимиро-Суздальского княжества
Презентация на тему Воспитательский час по ПДД «Регулирование дорожного движения
ЭЛЕМЕНТЫ МАШИНОВЕДЕНИЯ
Светлый праздник ПАСХИ
Информационно-аналитическая система Web-консолидация
Концепция естественнонаучного образования школьников
Презентация на тему Ленин
Septem Partners
Система автоматического удаления зольных отложений
Донецький ІППО Відділ освіти Красноармійської міської ради кабінет дошкільної освіти Донецький ІППО Відділ освіти Красноармійсь
Презентация на тему Экскурсия в школьную мастерскую
The most unusual laws in Great Britain
ВЫБОР ПРОФЕССИИ
Союза соотечественниц
Проектный продукт. Шаблон
Презентация на тему Структура технологической культуры
20141106_prezentatsiya_maykop
Информационное обеспечение процессов планирования и учета воздушного движения с использованием технологии Cache`™ на примере фили
Образовательное путешествие Берлин
РАЗРАБОТКА И ВНЕДРЕНИЕ УЧЕБНИКОВ ПО БАЙКАЛОВЕДЕНИЮ В ШКОЛЬНОЕ ОБРАЗОВАНИЕ БАЙКАЛЬСКОГО РЕГИОНА
Урок-игра по литературе 9 класс
Использование ИКТ в различных формах огранизации музыкальной деятельности дошкольников