Questions and Answers
Problems and Solutions
Quotes help make search much faster. Example: "Practice Makes Perfect"
Monday, December 3, 2012
Codecademy: Codeyear Ternary Operator
//sample solution
var x = 2;
var y = 1;
//The ternary operator in action
//result = x > y ? "good job" : 20;
//Rewrite the ternary code using if else statements
if(x>y){
result = "good job";
} else {
result = 20;
}
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
Codeyear: Deal It Out
//sample solution // Card Constructor function Card(num1,num2) { //properties var suit = num1; var number = num2; //methods ...
Codeschool Cliffs of Value Modulus Sample Solution
Find an expression using two values and the modulus operator that results as 4 Answer: 32%7
(no title)
Question: The total power dissipation in an RL series circuit is due to which component? Answer: The total power dissipation is due to ...
Ideal current source resistance
Question: How much internal resistance does an ideal current source have? Answer: An ideal current source has infinite resistance.
FreeCodeCamp Spinal Tap Case Sample Solution
function spinalCase(str) { var str2 = str.replace(/([a-z](?=[A-Z]))/g,'$1 '); var newStr = str2.replace(/\s|\x5F/g,"-...
Codecademy Sample Solution: Authentication and API Keys
// What's an API key? // A: An alphanumeric string used to identify you to an API // B: An OAuth token // C: An All-Purpose Interne...
Codecademy - Sun, Earth, and Code: Spin please
// Sample solution to style.css html, body { /* The universe takes up all available space */ width: 100%; height: 100%; ...
FreeCodeCamp Steamroller Sample Solution
function steamrollArray(arr) { // I'm a steamroller, baby var flattened = arr.reduce( function(a, b) { return a.conca...
Maximum Power Transfer in DC Circuits
Question: When is the maximum power delivered from a practical source to a load? Answer: Maximum power is delivered to the load when it...
Try Objective C: Level 1 Challenge 8
//sample solution NSNumber *age = @10; Back to the list of sample solutions for Try Objective C: Level 1 challenges
No comments:
Post a Comment