Conditional Execution

 

 

Lonce Wyse

Communication & New Media

lonce.wyse@cnm.nus.sg

test

do 'A'

do 'B'

Flow of Control

true ? 

false ? 

if  ( true) { do something }  

else  { do another thing }

Flow of Control

        // Create a variable to_keep_track of some state
        var state = 0;   // defined *outside* of function

        // callback
        obj.addEventListener('click', function(ev){
            if (state === 0){
                state=1;
            } else {
                state=0;
            }
            console.log("state is now " + state)
        });

Conditional Flow

By lonce

Conditional Flow

A brief overview of audio synthesis fundamentals, and how to create interactive audio on the Web.

  • 631