Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

add.js 444B

123456789101112131415161718
  1. function add(a, b) {
  2. return a + b;
  3. }
  4. function sum() {
  5. // Convert arguments object to array
  6. var args = Array.prototype.slice.call(arguments);
  7. // Throw error if arguments contain non-finite number values
  8. if (!args.every(Number.isFinite)) {
  9. throw new TypeError('sum() expects only numbers.')
  10. }
  11. // Return the sum of the arguments
  12. return args.reduce(function(a, b) {
  13. return a + b
  14. }, 0);
  15. }