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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"/> | |
| <title>About Me</title> | |
| <style> | |
| .listitem { | |
| color: red; | |
| } | |
| </style> |
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 img = document.getElementById('hplogo'); | |
| img.width = 400; | |
| img.src = 'http://www.logostage.com/logos/yahoo.GIF'; | |
| var button = document.getElementById('gbqfba'); | |
| button.innerHTML = 'Yahoooo!'; |
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 readingList = [ | |
| { title : 'y tu mama tambien', | |
| author : 'someone', | |
| alreadyRead : true }, | |
| { title : 'le petite prince', | |
| author : 'someone', | |
| alreadyRead : true } | |
| ] | |
| for (var i = 0; i < readingList.length; i++) { |
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 recipeCard = { | |
| 'title': 'tamales', | |
| 'servings': 1, | |
| 'ingredients': ['masa', 'butter', 'beer'] } | |
| console.log(recipeCard.title); | |
| console.log('Servings: ' + recipeCard.servings); | |
| console.log('Ingredients: '); | |
| for (var i = 0; i < recipeCard.ingredients.length; i++) { | |
| console.log(recipeCard.ingredients[i]); |
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
| function squareNumber(num) { | |
| var squaredNumber = num * num; | |
| console.log('The result of squaring the number ' + num + ' is ' + squaredNumber); | |
| return squaredNumber; | |
| } | |
| squareNumber(3); | |
| function halfOf(num) { | |
| var half = num / 2; |
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
| function areaOfCircle(radius) { | |
| r = Math.PI * (radius * radius); | |
| rou = Math.round(r) | |
| return "The area for a circle with radius " + radius + " is " + rou; | |
| } | |
| console.log(areaOfCircle(2)); |
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
| function percentOf(num1, num2) { | |
| n = num1/num2*100; | |
| return num1 + " is " + Math.round(n) + " % of " + num2; | |
| } | |
| console.log(percentOf(2, 4)); |
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
| function squareNumber(num) { | |
| return "The result of squaring the number " + num + " is " + num*num; | |
| } | |
| console.log(squareNumber(3)); |
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
| function mixUp(word, other_word) { | |
| return other_word.slice(0, 2) + word.slice(2) + " " + word.slice(0, 2) + other_word.slice(2); | |
| } | |
| console.log(mixUp('cat', 'dog')); |
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
| function drEvil(money_amount) { | |
| if (money_amount > 100000) { | |
| return money_amount + " dollars (pinky)"; | |
| } else { | |
| return money_amount + " dollars"; | |
| } | |
| } | |
| console.log(drEvil(10)); |