dashboard
repositories
filestore
activity
search
login
javascript-vorlesung
/
example-projects-2026
summary
reflog
commits
tree
tickets
docs
forks
compare
blame
|
history
|
raw
review code update to ES arrow function
Hong-Phuc Bui
2025-10-17
85e9b6730a1c181d3c0d4a1a11ea3648dfac717c
[javascript-vorlesung/example-projects-2026.git]
/
textbased-programms
/
harmonic.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
* harmonic.js
*
*/
import {terminal} from "./dfhi.js";
window.main = (...argv) => {
const n = Number.parseInt(argv[0]);
let h = 0;
for(let i = 1; i <=n; ++i) {
h += 1/i;
}
terminal.printl(`H_${n} = ${h}`);
};