diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 20:22:09 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-21 20:22:09 +0100 |
| commit | 5a8dbc6347b3541e84fe669b22c17ad3b715e258 (patch) | |
| tree | b148c450939688caaaeb4adac6f2faa1eaffe649 /samples/test.js | |
| download | qwe-editor-5a8dbc6347b3541e84fe669b22c17ad3b715e258.tar.gz | |
Engage!
Diffstat (limited to 'samples/test.js')
| -rw-r--r-- | samples/test.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/samples/test.js b/samples/test.js new file mode 100644 index 0000000..032b94d --- /dev/null +++ b/samples/test.js @@ -0,0 +1,40 @@ +// JavaScript Test File + +// explain javascript to me + +// convert to fat arrow style +function heavyComputation(a, b) { + const factor = 2.5; + let result = 0; + + // Perform loop + for (let i = 0; i < 10; i++) { + if (i % 2 === 0) { + result += (a * b) * factor; + } else { + result -= i; + } + } + + return result; +} + +const user = { + name: "John Doe", + age: 30, + isActive: true +}; + +console.log("Starting computation..."); +var output = heavyComputation(10, 20); +console.log(`Final Result: ${output}`); + +class Processor { + constructor(data) { + this.data = data; + } + + process() { + return this.data.map(x => x * 2); + } +} |
