This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import code; code.interact(local=dict(globals(), **locals())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var john = { | |
| 'firstName':'john', | |
| 'lastName':'doe', | |
| 'phone':'(512) 355-0453', | |
| 'email':'johndoe@email' | |
| }; | |
| var jane = { | |
| 'firstName':'jane', | |
| 'lastName':'doe', | |
| 'phone':'(312) 641-2203', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var convertToOunces = function() { | |
| for (i=0;i<cups.length;i++) { | |
| ounces[i] = cups[i] * 8; | |
| } | |
| }; | |
| var scores = [83,40,55,72,59,88,99]; | |
| var passOrFail = function() { | |
| for (i=0;i<scores.length;i++) { | |
| if (scores[i]>=60) { | |
| scores[i] = "pass"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var contacts = ["Matt Smith", "Sam Davis", "Ashley Jones"]; | |
| var findContact = function(index) { | |
| var get = contacts[index]; | |
| return get; | |
| }; | |
| var addContact = function(name) { | |
| contacts.push(name); | |
| }; | |
| var updateLastContact = function(newName) { | |
| var long = contacts.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this code is my attempt at answer to question 1, I am not sure why it is not working | |
| var apple = document.getElementsByClassName('current'); | |
| for ( i=0; i<apple.length; i++) { | |
| document.getElementsByClassName('current').className = 'finished'; | |
| } | |
| document.getElementById('next').className = 'current'; | |
| document.getElementById('next').removeAttribute('id'); | |
| document.getElementsByTagName('li')[3].setAttribute('id', 'next'); | |
| var addCool = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.querySelectorAll('.current')[1].textContent = 'Me Talk Pretty One Day.' | |
| document.getElementById('next').innerHTML = '<a href="http://www.amazon.com/Flamethrowers-Rachel-Kushner/dp/1439142017/ref=sr_1_1?ie=UTF8&qid=1458897183&sr=8-1&keywords=the+flamethrowers">The Flamethrowers</a>'; | |
| document.querySelector('li').innerHTML = 'The Wind Up <strong>Bird</strong> Chronicle.'; | |
| document.querySelectorAll('li')[3].textContent = "I'm the fourth!" | |
| var listLi = document.getElementsByTagName('li'); | |
| for (i=0;i<listLi.length;i++) { | |
| document.getElementsByTagName('li')[i].textContent = 'JavaScript rules!' | |
| } | |
| document.getElementsByClassName('current')[0].innerHTML = 'Manipulating the DOM is fun!'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fizzBuzz = function(a) { | |
| for (i = 1; i <= a; i++) { | |
| if (fizz(i)&&buzz(i)) { | |
| console.log("fizzBuzz"); | |
| } | |
| else if (fizz(i)) { | |
| console.log("fizz"); | |
| } | |
| else if (buzz(i)) { | |
| console.log("buzz"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //write your answer below | |
| var sayHello = function(name) { | |
| return "Hello" + name; | |
| }; | |
| var areBothEven = function(a,b) { | |
| if ((a%2 === 0)$$(b%2 ===s 0)) { | |
| return true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body{ | |
| font-size: 18px; | |
| font-family: 'Open Sans', sans-serif; | |
| } | |
| h1{ | |
| font-size: 2em; | |
| } | |
| h2{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body{ | |
| font-size: 18px; | |
| font-family: "Open sans", "sans serif"d; | |
| } | |
| h1{ | |
| font-size: 2em; | |
| font-weight: 800px; | |
| } |
NewerOlder