Nodejs

No description

fork
loading
Files
  • index.js

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.8763547034455894","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"ZnVuY3Rpb24gc2VyaWVzKHRlcm1zLCB0ZXJtRnVuYykgewogIHJldHVybiBBcnJheSh0ZXJtcykuZmlsbCgpLm1hcCgoeCwgbikgPT4gdGVybUZ1bmMobikpLnJlZHVjZSgoYWNjLCBuKSA9PiBhY2MgKyBuKTsKfQpmdW5jdGlvbiBhbHRfc2VyaWVzKHRlcm1zLCB0ZXJtRnVuYykgewogIHJldHVybiBBcnJheSh0ZXJtcykuZmlsbCgpLm1hcCgoeCwgbikgPT4gKC0xKSoqbiAqIHRlcm1GdW5jKG4pKS5yZWR1Y2UoKGFjYywgbikgPT4gYWNjICsgbik7Cn0K"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
function series(terms, termFunc) {
  return Array(terms).fill().map((x, n) => termFunc(n)).reduce((acc, n) => acc + n);
}
function alt_series(terms, termFunc) {
  return Array(terms).fill().map((x, n) => (-1)**n * termFunc(n)).reduce((acc, n) => acc + n);
}
node v10.16.0