From faa6106907064b76cc97116d2d2fe7e925ddf980 Mon Sep 17 00:00:00 2001 From: Shanna Sullivan Date: Mon, 4 Jan 2016 18:59:05 -0800 Subject: [PATCH 1/6] added .DS_Store to .gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cd5a533..9ed93e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ #Modules bower_components -node_modules \ No newline at end of file +node_modules + +.DS_Store \ No newline at end of file From 987e105b376d2d8b9f588485df00e964b569ac3b Mon Sep 17 00:00:00 2001 From: Shanna Sullivan Date: Mon, 4 Jan 2016 19:20:15 -0800 Subject: [PATCH 2/6] added slide changes for slide 7 - primitive data types --- slideChanges.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 slideChanges.js diff --git a/slideChanges.js b/slideChanges.js new file mode 100644 index 0000000..6848c54 --- /dev/null +++ b/slideChanges.js @@ -0,0 +1,20 @@ +// JS Data Types Review +// slide 7 + + // Primitive Data Types + 'hello world' // string + 'hello world'[6] // w + + 5 // integer + 5 * 5 // 25 + + true // boolean + !true // false + + null // null + !null // true + !! null // false + + undefined // undefined + !undefined // true + !! undefined // false \ No newline at end of file From 885c387626742d745e24c6997d91673710b61938 Mon Sep 17 00:00:00 2001 From: Shanna Sullivan Date: Mon, 4 Jan 2016 20:10:04 -0800 Subject: [PATCH 3/6] added comments. commented out meat of characterEscapes function so it doesn't break everything else before students fix it --- rawstrings.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rawstrings.js b/rawstrings.js index 67ef072..f066378 100644 --- a/rawstrings.js +++ b/rawstrings.js @@ -9,28 +9,31 @@ var printLetter1 = function () { return 'print the fourth letter in this string'; }; +// Find and use a method that creates one string out of the two strings in the function body +// Output: 'Javascript is so much fun I wish I could code in javascript all day, every day!' var bridgeString1 = function() { - 'Javascript is so much fun' + 'Javascript is so much fun.' 'I wish I could code in javascript all day, every day!' return }; +// this function seems out of place - move to another deck? var characterEscapes = function() { - 'I can't think of it right now. I don't have any idea.' +// 'I can't think of it right now. I don't have any idea.' }; /////////////////// STRING METHODS ///////////////////// /* -SEARCH THE INTERNET FOR 'JAVASCRIPT STRING METHODS'. +SEARCH THE INTERNET FOR 'JAVASCRIPT STRING METHODS'. FIND AND USE METHODS TO SOLVE THE FOLLOWING PROBLEMS */ // Create a function that returns the 10th letter of the string: // 'print the tenth letter in this string' - // Output: + // Output: var printLetter2 = function() { return 'print the twelfth letter in this string'; }; @@ -43,8 +46,8 @@ var bridgeString2 = function() { return }; +// Remove the word 'Python' and replace it with 'JavaScript' var replaceString = function() { - // Remove the word 'Python' and replace it with 'JavaScript' 'I wish I could code in Python all day, every day!' }; From ee6c9dc22bb1c164907e935eccdb6faabe149e3c Mon Sep 17 00:00:00 2001 From: Shanna Sullivan Date: Mon, 4 Jan 2016 20:10:56 -0800 Subject: [PATCH 4/6] added changes to primitive data types - changes to existing slide 7 and a new slide 7.5 --- slideChanges.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/slideChanges.js b/slideChanges.js index 6848c54..710ae4a 100644 --- a/slideChanges.js +++ b/slideChanges.js @@ -3,7 +3,7 @@ // Primitive Data Types 'hello world' // string - 'hello world'[6] // w + 'hello world'[6] // 'w' 5 // integer 5 * 5 // 25 @@ -17,4 +17,16 @@ undefined // undefined !undefined // true - !! undefined // false \ No newline at end of file + !! undefined // false + +// slide 7.5 + + // Introduce variables + // variables point to data + var dogName = 'Spot'; + dogName; // 'Spot' + var myDog = 'Freckles'; + myDog; // 'Freckles' + myDog = dogName; + myDog; // 'Spot' + From 825f09ce676090aa6626ddbe7d0d1af1a9f94b00 Mon Sep 17 00:00:00 2001 From: Shanna Sullivan Date: Mon, 4 Jan 2016 20:11:54 -0800 Subject: [PATCH 5/6] added basic tests for bridgeString1() and characterEscapes() --- spec/rawstrings.spec.js | 48 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/spec/rawstrings.spec.js b/spec/rawstrings.spec.js index f392133..c9f0391 100644 --- a/spec/rawstrings.spec.js +++ b/spec/rawstrings.spec.js @@ -1,20 +1,60 @@ /* global raw strings, describe, it, expect, should */ -describe('printLetter()', function () { +describe('printLetter1()', function () { 'use strict'; it('exists', function () { - expect(printLetter).to.be.a('function'); + expect(printLetter1).to.be.a('function'); }); it('does something', function () { - expect(typeof printLetter()).to.equal('string'); + expect(typeof printLetter1()).to.equal('string'); }); it('does something else', function () { - expect(printLetter()).to.equal('n'); + expect(printLetter1()).to.equal('n'); }); // Add more assertions here }); + +describe('bridgeString1()', function () { + 'use strict'; + + it('exists', function() { + expect(bridgeString1).to.be.a('function'); + + }); + + it('does something', function () { + expect(typeof bridgeString1()).to.equal('string'); + + }); + + it('does something else', function() { + expect(bridgeString1()).to.equal('Javascript is so much fun. I wish I could code in javascript all day, every day!') + + }); + +}); + +describe('characterEscapes()', function() { + 'use strict'; + + it('exists', function () { + expect(characterEscapes).to.be.a('function'); + + }); + + it('does something', function () { + expect(typeof characterEscapes()).to.equal('string'); + + }); + + it('does something else', function () { + expect(characterEscapes()).to.equal('I can\'t think of it right now. I don\'t have any idea.'); + + }); + +}) \ No newline at end of file From b86768c4758278738f881f07ad65cb70339bba50 Mon Sep 17 00:00:00 2001 From: Shanna Sullivan Date: Tue, 5 Jan 2016 15:10:14 -0800 Subject: [PATCH 6/6] changed 'integer' to 'number' --- slideChanges.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slideChanges.js b/slideChanges.js index 710ae4a..8a842e9 100644 --- a/slideChanges.js +++ b/slideChanges.js @@ -5,7 +5,7 @@ 'hello world' // string 'hello world'[6] // 'w' - 5 // integer + 5 // number 5 * 5 // 25 true // boolean