Att använda matematik

author: krm
created: 2026-05-22
status: alpha

1. 🪧 Om att ta absolut belopet?

const  a = Number(prompt("A?"));
const result = Math.abs(a);
console.log(result);

1. 🐾 Test 1

> -1

2. 🐾 Test 2

> -2

2. 🪧 Om att ta absolut belopet?

const  v = Number(prompt("Hastighet?"));
const  t = Number(prompt("Tid?"));
const s = v*t;
console.log(s);

1. 🐾 Test 1

> 1
> 0

2. 🐾 Test 2

> 3
> 2

3. 🪧 Om att ta absolut belopet?

const  a = Number(prompt("A?"));
const result = (a+1)**a;
console.log(result);

1. 🐾 Test 1

> 1

2. 🐾 Test 2

> 3