- What value is now stored in the variable name?
var isKing = true;
var name = isKing ? ‘Arthur’ : ‘Hank’;
-
What is the difference between == and === in Javascript?
-
Write a function that takes two numbers as arguments and returns the sum of the two numbers in Javascript
-
Write a function that takes an array as an argument and prints out the numbers in the array that are greater than 5 (for example foo([3,6,1,7]) would print out 6 and 7) in Javascript
-
Write a for loop that will iterate from 0 to 20. For each iteration, it will check if the current number is even or odd, and report that to the screen in Javascript
-
What does 'this' refer to when used in a Java method?
-
Create an object that has properties with name = "fred" and major="music" and a property that is a function that takes 2 numbers and returns the smallest of the two, or the square of the two if they are equal.
-
What’s the result of executing this code and why?
function test() {
console.log(a);
console.log(foo());
var a = 1;
function foo() {
return 2;
}
}
test();
-
Describe what a class is in Ruby in a few sentences.
-
Write a function that takes two numbers as arguments and returns the sum of the two numbers in Ruby
-
What is similar and what is different between the this implementation and the one in Javascript (exercise 3)?
-
Write a function that takes an array as an argument and prints out the numbers in the array that are greater than 5 (for example foo([3,6,1,7]) would print out 6 and 7) in Ruby
-
What is similar and what is different between the this implementation and the one in Javascript (exercise 4)?
-
Write a for loop that will iterate from 0 to 10. For each iteration of the for loop, it will multiply the number by 9 and log the result (e.g. "2 * 9 = 18") in Ruby
-
Classes
a. Create a Celsius class, that takes the temperature as a parameter.
b. In that same class, define a method that returns the temperature in Fahrenheit. For the conversion we can use the formula temperature*1.8 + 32. Round up the result so it doesn’t contain any decimal values.
c. In that same class, create a to_s method, that returns the Celsius temperature formatted e.g. 16 degrees C
-
Assume that you created a new file in a project. What would you do to start tracking it under git (let's assume that the direktory you are currently in already exists)?
-
In the morning, what would you do to make sure you have the most current git branch on your local machine?
-
How would you create a new folder named 'new_folder' in the command line?
-
Assuming you created that folder, how would you access that folder using the command line?
-
What is an 'ul' and an 'ol' in HTML? What are the similarities and differences?
-
What is the HEAD and BODY in HTML? What would both contain?
-
How would you require a javascript file (for instance test.js, which is on the same level as the HTML) in HTML?
-
How qould you require a css file (for instance test.css, which is two level deeper as the HTML) in HTML?