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 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!' }; diff --git a/slideChanges.js b/slideChanges.js new file mode 100644 index 0000000..8a842e9 --- /dev/null +++ b/slideChanges.js @@ -0,0 +1,32 @@ +// JS Data Types Review +// slide 7 + + // Primitive Data Types + 'hello world' // string + 'hello world'[6] // 'w' + + 5 // number + 5 * 5 // 25 + + true // boolean + !true // false + + null // null + !null // true + !! null // false + + undefined // undefined + !undefined // true + !! 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' + 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