Loading JavaScript Best Practices - Working Files/Chapter 1/No Work Files.rtf 0 → 100755 +7 −0 Changes for JavaScript Best Practices - Working Files/Chapter 1/No Work Files.rtf: 7 added lines, 0 removed lines. Original line number Diff line number Diff line {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww9000\viewh8400\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs24 \cf0 No work files for this lesson...} No newline at end of file JavaScript Best Practices - Working Files/Chapter 2/curly-braces.js 0 → 100755 +8 −0 Changes for JavaScript Best Practices - Working Files/Chapter 2/curly-braces.js: 8 added lines, 0 removed lines. Original line number Diff line number Diff line function createObj(x, y) { return { x: x, y: y }; } var obj = createObj(1, 2); No newline at end of file JavaScript Best Practices - Working Files/Chapter 2/equality.js 0 → 100755 +11 −0 Changes for JavaScript Best Practices - Working Files/Chapter 2/equality.js: 11 added lines, 0 removed lines. Original line number Diff line number Diff line var a = 1; var b = 2; var c = "1"; console.log(a == b); console.log(a != b); console.log(a == c); console.log(a === c); console.log(a !== c); JavaScript Best Practices - Working Files/Chapter 2/functions.html 0 → 100755 +6 −0 Changes for JavaScript Best Practices - Working Files/Chapter 2/functions.html: 6 added lines, 0 removed lines. Original line number Diff line number Diff line <html> <head></head> <body> <script src="functions.js"></script> </body> </html> No newline at end of file JavaScript Best Practices - Working Files/Chapter 2/functions.js 0 → 100755 +31 −0 Changes for JavaScript Best Practices - Working Files/Chapter 2/functions.js: 31 added lines, 0 removed lines. Original line number Diff line number Diff line // function elementClickHandler(e) { // // do whatever work // } // let elementMouseOverHandler = function(e) { // // do whatever work // } // function init(element) { // element.addEventListener("click", elementClickHandler); // element.addEventListener("mouseover", elementMouseOverHandler); // } // init(foo); // init(bar); function sumOne(a, b) { return a + b; } let sumTwo = function(a, b) { return a + b; }; let sumThree = (a, b) => a + b; console.log(sumOne(1, 2)); console.log(sumTwo(1, 3)); console.log(sumThree(1, 4)); Loading
JavaScript Best Practices - Working Files/Chapter 1/No Work Files.rtf 0 → 100755 +7 −0 Changes for JavaScript Best Practices - Working Files/Chapter 1/No Work Files.rtf: 7 added lines, 0 removed lines. Original line number Diff line number Diff line {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 {\fonttbl\f0\fswiss\fcharset0 Helvetica;} {\colortbl;\red255\green255\blue255;} \margl1440\margr1440\vieww9000\viewh8400\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs24 \cf0 No work files for this lesson...} No newline at end of file
JavaScript Best Practices - Working Files/Chapter 2/curly-braces.js 0 → 100755 +8 −0 Changes for JavaScript Best Practices - Working Files/Chapter 2/curly-braces.js: 8 added lines, 0 removed lines. Original line number Diff line number Diff line function createObj(x, y) { return { x: x, y: y }; } var obj = createObj(1, 2); No newline at end of file
JavaScript Best Practices - Working Files/Chapter 2/equality.js 0 → 100755 +11 −0 Changes for JavaScript Best Practices - Working Files/Chapter 2/equality.js: 11 added lines, 0 removed lines. Original line number Diff line number Diff line var a = 1; var b = 2; var c = "1"; console.log(a == b); console.log(a != b); console.log(a == c); console.log(a === c); console.log(a !== c);
JavaScript Best Practices - Working Files/Chapter 2/functions.html 0 → 100755 +6 −0 Changes for JavaScript Best Practices - Working Files/Chapter 2/functions.html: 6 added lines, 0 removed lines. Original line number Diff line number Diff line <html> <head></head> <body> <script src="functions.js"></script> </body> </html> No newline at end of file
JavaScript Best Practices - Working Files/Chapter 2/functions.js 0 → 100755 +31 −0 Changes for JavaScript Best Practices - Working Files/Chapter 2/functions.js: 31 added lines, 0 removed lines. Original line number Diff line number Diff line // function elementClickHandler(e) { // // do whatever work // } // let elementMouseOverHandler = function(e) { // // do whatever work // } // function init(element) { // element.addEventListener("click", elementClickHandler); // element.addEventListener("mouseover", elementMouseOverHandler); // } // init(foo); // init(bar); function sumOne(a, b) { return a + b; } let sumTwo = function(a, b) { return a + b; }; let sumThree = (a, b) => a + b; console.log(sumOne(1, 2)); console.log(sumTwo(1, 3)); console.log(sumThree(1, 4));