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
Codecademy Sample Solution: Projects The Nakedness Beneath jQuery
var my_canvas=document.getElementById('canvas'); var context=my_canvas.getContext('2d');
Codecademy: "Formatting with String Methods"
#sample solution print "What's your first name?" first_name = gets.chomp.capitalize! print "What's your last na...
Current for full scale deflection
Question: What current is required for full scale deflection of a galvanometer having a current sensitivity of 50 micro-amperes per scale di...
DataCamp Combining data types Sample Solution
# Update data types year_1_str = str(year_1) revenue_1_str = str(revenue_1) # Create a complete sentence combining only the string d...
Codecademy Learn Phaser: Keyboard Events 10/12
//Sample Solution const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
What is edema aquosum?
This is caused by the entrance of water into the air sacs which makes the lungs doughy, readily pits on pressure, exuding water and froth
FreeCodeCamp Nesting For Loops Sample Solution
function multiplyAll(arr) { var product = 1; // Only change code below this line for (var i=0; i < arr.length; i++) { for (...
What is Locus minoris Resistencia?
Answer: This is the type of injury when a blow to the forehead causes a contusion of the eyeball due to the fracture of the bone at the r...
SQL Problem: Display the first name and age for everyone that's in the table
Solution: SELECT first_name, age, FROM table_name;
Scrolling Text Using Javascript
This is the scrolling text . Code for the scrolling effect is written below: <style type="text/css"> #scro...
No comments:
Post a Comment