Download presentation
Presentation is loading. Please wait.
Published byRosanna Dickerson Modified over 6 years ago
1
JavaScript Selection Statement Creating Array
window.setInterval(expression/function, time)
2
Selection Statement Selection or conditional statements perform different actions based on different conditions If Statement Syntax if( condition ) Statement Semantics Evaluate the condition (true or false) If the condition is true True: DO STATEMENT False: SKIP the STATEMENT
3
Selection Statement Syntax: if…else if(condition){ }else { }
if the condition is true, the code in here is executed }else { if the code is false, the code in here is executed }
4
Creating Array Array object stores a list of values
Each value is an element of the Array and has an associated index Create array with initial values var arrayName = new Array(elment0, element1, element2, etc);
5
Creating Array Create array with size defined
var arrayName = new Array(3); arrayName[0] = value; arrayName[1] = value; arrayName[2] = value;
6
SetInterval JavaScript execution in response to timer event
Write up the code you would like executed multiple time at regular interval Use the setInterval of the window class Syntax: window.setInterval(expression/function , time in millisecond);
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.