Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web Development 102

Karl Li
September 19, 2014

Web Development 102

Karl Li

September 19, 2014
Tweet

More Decks by Karl Li

Other Decks in Technology

Transcript

  1. Variables var text = 'String'; var number = 1; var

    boolean = false; var pi = 3.1415926;
  2. Functions function test() { console.log('test'); } test(); var log; log

    = function(text) { console.log(text); } log('something wrong');
  3. function welcome(name, title) { console.log('Welcome ' + name + ',

    the ' + title); } welcome('Bill Gates', 'CEO');
  4. If else function welcome(age) { if (age > 30) {

    console.log('Welcome'); } else { console.log("Hey, boy. what's up"); } } welcome(31);
  5. function welcome(age) { if (age > 30) { console.log('Welcome'); }

    else if (age > 60) { console.log('Hello, old man.'); } else { console.log("Hey boy, what's up?"); } } welcome(50);
  6. Loops var person = ['Karl', 'Dylan', 'Jimmy', 'Anderson']; for (var

    i = 0; i < person.length; i ++) { console.log(person[i]); }
  7. Everything in JS is an Object var text = 'Hello

    World'; console.log(text.length); console.log(text.indexOf('o')); console.log(text.toUpperCase()); console.log(text.toLowerCase());
  8. Title # H1 ## H2 ### H3 #### H4 #####

    H5 ###### H6 <h1>H1</h1> <h2>H2</h2> <h3>H3</h3> <h4>H4</h4> <h5>H5</h5> <h6>H6</h6>
  9. Unsorted List * Karl + Jimmy - Dylan <ul> <li>Karl</li>

    <li>Jimmy</li> <li>Dylan</li> </ul> » Karl » Jimmy » Dylan
  10. Sorted List 1. Karl 4. Jimmy 2. Dylan <ol> <li>Karl</li>

    <li>Jimmy</li> <li>Dylan</li> </ol> 1.Karl 2.Jimmy 3.Dylan