Skip to content

Instantly share code, notes, and snippets.

@sergiulucutar
Last active October 30, 2019 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save sergiulucutar/a84cab9b5cf52ba1118de15654cbc433 to your computer and use it in GitHub Desktop.
Save sergiulucutar/a84cab9b5cf52ba1118de15654cbc433 to your computer and use it in GitHub Desktop.
Intro in JavaScript, Homework 1
  1. What is the result of the following statements? Why?
!!0 == '0'

3 + '4'

2 * 7 / 0

var pers = {
  name: 'John',
  age: 34
}
pers.name

pers['age']
  1. What does this program do?
const result = prompt("What language are we learning?");
if(result === "javascript"){
  console.log("You're right!");
}
else{
  console.log("No!");
}
  1. Modify the program form exercise 2 so it will ask until you get the right answer.

  2. Given a number, write a program that will log the Fibonacci sequence until it reaches the given number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment