![]() |
|
[Java] Code Academy Answer Key - Introduction To Programming With Javascript - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] Code Academy Answer Key - Introduction To Programming With Javascript (/showthread.php?tid=2916688) |
Code Academy Answer Key - Introduction To Programming With Javascript - RF2OOO - Oct 4, 2012 Code Academy makes learning Javascript and other programming languages easy and fun! You don't have to join the site in order to learn but it is a good idea to try out each exercise on your own before checking out the answers. By the time you complete all the exercises, you'll have a basic understanding of how javascript works and will be able to create your own with ease! I found the site extremely helpful and decided to create this answer key to help anyone interested in learning javascript. Enjoy! :) Introduction Exercise 0 - Name Code "unknown"Introduction Exercise 1 - Character Length Code "unknown".lengthIntroduction Exercise 2 - Simple Math Code 3 + 4Introduction Exercise 3 - More Simple Math Code 100 / 20Introduction Exercise 4 - Reference Error Code eggplantSection 1 Exercise 0 - Character Length Plus Simple Math Code "cake".length * 9Section 1 Exercise 1 - Executing Javascript Code // click RunSection 1 Exercise 2 - Interactive Javascript Code confirm("I feel awesome!");Section 1 Exercise 3 - Inputs & Javascript Code prompt("Where are you from?");Section 1 Exercise 4 - Data Types 1 & 2: Numbers & Strings Code "This is easy".lengthSection 1 Exercise 5 - Data Type 3: Booleans Code "I'm coding like a champ!".length > 10Section 2 Exercise 0 - Using Console Log Code console.log(2 * 5)Section 2 Exercise 1 - Comparisons Code console.log(15 > 4);Section 2 Exercise 2 - Conditional Statements Code if (100 > 2); {Section 2 Exercise 3 - Else Statements Code if (10 > 5 * 2) {Section 2 Exercise 4 - More Conditional Statements Code if ("computer".length * 2 === 16) {Section 2 Exercise 5 - Java Syntax Code if (10 === 10) {Section 3 Exercise 0 - Mid-Lesson Review Code if (12 / 4 === "Ari".length) {Section 3 Exercise 1 - Math Code if ("Jon".length * 2 / (2 + 1) === 2) {Section 3 Exercise 2 - Math & The Modulo Code console.log(14 % 3);Section 3 Exercise 3 - Modulo & "if / else" Code if (99 % 3 === 0) {Section 3 Exercise 4 - Substrings Code "wonderful day".substring(3, 7)Section 3 Exercise 5 - More Substrings Code console.log("January".substring(0, 3));Section 4 Exercise 0 - Variables Code var myAge = 678;Section 4 Exercise 1 - More Variables Code var myCountry = "America";Section 4 Exercise 2 - Change Variable Values Code var myName = "unknown";Section 4 Exercise 3 - Conclusion Part 1 Review Code // lol winSection 4 Exercise 4 - Conclusion Part 2 Final Code if ("Code Academy Rocks!!".length * 5 === 100) { |