Questions and Answers
Problems and Solutions
Quotes help make search much faster. Example: "Practice Makes Perfect"
Monday, December 3, 2012
Codecademy: Codeyear Setting values using a ternary operator
//sample solution
var food = prompt("What food would you suggest?");
/*if (food === "taco") {
foodType = "Mexican";
} else {
foodType = "other";
}*/
//Re-write the above code using a ternary operator
foodType = food === "taco" ? "Mexican" : "other";
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
This is an example of
scrolling text
using Javascript.
Popular Posts
Codecademy Learn Phaser: Keyboard Events 10/12
//Sample Solution const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
Physical injury is considered slight if the victim is incapacitated for how long?
Answer: From 1 to 9 days
Array Element Tally
Say you had an election, and you needed to tally the votes for each candidate. All you need to do is enter the name of each candidate o...
Codeschool Sample Solution Removing the clicked button
$(document).ready(function(){ $("button").on("click", function(){ var message = $("<span>Call 1-555-...
Codecademy > Learn Java > Classes: Instance Variables Sample Solution
class Dog{ int age; public Dog(){ } public static void main(String[] args) { } }
Codecademy - Animate Your Name: Arrays
//Sample solution to main.js var red = [0, 100, 63]; var orange = [40, 100, 60]; var green = [75, 100, 40]; var blue = [196, 77, 55]; ...
SQL: Table Transformation Lesson 11 Sample Solution
Instructions: Select the items in the category column that are both in the newly acquired new_products table and the legacy_products table....
Codecademy ng-repeat I
//sample solution to MainController.js app.controller('MainController', ['$scope', function($scope) { $scope.title = ...
LearnStreet Sample Solution to Lesson 9 Exercise 3
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] # your code here numbers.collect! do |x| if x % 2...
Sqlcourse Selecting Data Exercise 4
Problem: Display the first and last names for everyone whose last name ends in an "ay". Solution: select first, last from e...
No comments:
Post a Comment