Skip to content

Instantly share code, notes, and snippets.

View Ingelheim's full-sized avatar

Lukas Ingelheim Ingelheim

View GitHub Profile
  1. What command would you run, along with any arguments, to set your name so it shows up in git commits?
git config --global user.name [your full name]

​ 2. What command would you run, along with any arguments, to show the differences in files that are staged from files that are already committed to the repository?

git diff staged

Exercises

Javascript

  1. What value is now stored in the variable name?
var isKing = true;
var name = isKing ? ‘Arthur’ : ‘Hank’;

Exercises

Javascript

  1. What value is now stored in the variable name?
var isKing = true;
var name = isKing ? ‘Arthur’ : ‘Hank’;

Exercises

Javascript

  1. What value is now stored in the variable name?
var isKing = true;
var name = isKing ? ‘Arthur’ : ‘Hank’;
  1. 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;
 }
  1. What value is now stored in the variable name?
var isKing = true;
var name = isKing ? ‘Arthur’ : ‘Hank’;

ANSWER

name = ‘Arthur’ 
# name is Arthur. This short syntax for an if statement is called ternary operator https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
  1. 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;
 }

Exercises

Javascript

  1. What value is now stored in the variable name?
var isKing = true;
var name = isKing ? ‘Arthur’ : ‘Hank’;

Exercises

Javascript

  1. What value is now stored in the variable name?
var isKing = true;
var name = isKing ? ‘Arthur’ : ‘Hank’;
  1. Which HTML 5 tag would you use for semantically correctly wrap your page navigation?
  2. What is the difference between a <div> and a <span> in HTML?
  3. What is wrong in the following HTML?
<div class="some class" id="someID"></div>
<div class="some class" id="someID"></div>
  1. How would you create a new folder named testFolder with the command line?
  2. How would you enter this folder?
  3. Given you are now in this folder, how would you check if git has already been initialized in that folder?