-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.js
More file actions
39 lines (32 loc) · 928 Bytes
/
code.js
File metadata and controls
39 lines (32 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* YYY 2018-02-02 check 'use strict for ES' YYY */
// Simple JavaScript syntax highlight code
'use strict';
class SquareKlasse {
constructor(valueIn) {
this.valueIn = valueIn;
}
squaredFunktion() {
return this.valueIn * this.valueIn;
}
}
function SquareKlasseES4 (valueIn) {
this.valueIn = valueIn;
}
SquareKlasseES4.prototype.squaredFunktion = function() {
return this.valueIn * this.valueIn;
}
function calculateFunktion(xParam,yParam) {
const vNice = Math.floor(Math.exp(yParam));
let vOut = Math.floor(yParam);
const vTop = vNice - (vOut + xParam);
while (vOut < vTop) {
vOut += 3;
}
const vObjekt = new SquareKlasse(vOut);
return vObjekt.squaredFunktion() + vNice + xParam;
}
const BARKONST = 1;
const BAZKONST = 3.7;
var resultVar = calculateFunktion(BARKONST, BAZKONST);
console.log("The result is:",resultVar);
console.log("Are you sure",resultVar,"is the correct number?");