@christinaSmith/

Calculate_age_js

JavaScript

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.3853470261747607","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"Y29uc3QgeWVhciA9IHByb21wdCgiV2hhdCB5ZWFyIHdlcmUgeW91IGJvcm4/Iik7Cgpjb25zdCBjYWxjdWxhdGVfYWdlID0gZnVuY3Rpb24oeWVhcikgewogIGxldCBhZ2UgPSAyMDE4IC0geWVhcgogIHJldHVybiBhZ2UKfQoKY29uc3QgeW91cl9hZ2UgPSBjYWxjdWxhdGVfYWdlKHllYXIpCgpjb25zb2xlLmxvZygiWW91IGFyZSAiICsgeW91cl9hZ2Up"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
const year = prompt("What year were you born?");

const calculate_age = function(year) {
  let age = 2018 - year
  return age
}

const your_age = calculate_age(year)

console.log("You are " + your_age)
Native Browser JavaScript