@wadecoplen/

Intro to JS

Nodejs

No description

fork
loading
Files
  • index.js
  • Coding Challenge
  • .map.js
  • Assignement_1_answers.js
  • Assignement_1.js
  • Assignment_2_answers.js
  • Assignment_2.js
  • Assignment_3_answers.js
  • Assignment_3.js
  • Assignment_4_answers.js
  • Assignment_4.js
  • Assignment_5_answers.js
  • Assignment_5.js
  • Assignment_6_answers.js
  • Assignment_6.js
  • Assignment_7_answers.js
  • Assignment_7.js
  • Assignment_8_answer.js
  • Assignment_8.js
  • Assignment_9_answers.js
  • Assignment_9.js
  • Assignment_x_answers.js
  • Assignment_x.js
  • Assignment_xi.answers.js
  • Assignment_xi.js
  • Assignment_xii_answers.js
  • Assignment_xii.js
  • Assignment_xiii_answers.js
  • Assignment_xiii.js
  • Assignment_xiv_answers.js
  • Assignment_xiv.js
  • Assignment_xv_answers.js
  • Assignment_xv.js
  • Assignment_xvi.js
  • assignmentFourteen.js
  • Callbacks.js
  • exampleFunctions.js
  • exerciseSixteen.js
  • Lesson: Callbacks.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*The Age Calculator
Forgot how old someone is? Calculate it!

Store the current year in a variable.
Store their birth year in a variable.
Calculate their 2 possible ages based on the stored values.
Output them to the screen like so: "They are either NN or NN", substituting the values.*/

var currentYear = prompt('What year is it?');
var birthYear = prompt('What is your birth year?');
let year = currentYear.prompt();
let bday = birthYear.prompt();
let age = year - bday;
let newAge = age++
function ageCalculation(){
	
}
return 'They are either ' + age + ' or ' + age++;
node v10.16.0