JavaScript Inheritance and Object Programming

Coding Tutorial, Chapter 3c

An Object-Programming Library Function: sum() Objects

© 18 July, 2013, Martin Rinehart


Use alert()s (or console.log()s) to test your new function. Test the fringe cases as well as the main ones. This function must be robust!


We suggest placing library functions in alphabetical order before classes and mainline.

A single test is shown. Use a generous, carefully thought out group of tests. What happens if one or both objects are empty? (That's just one example of the fringe cases.)

Feedback: Martin Rinehart at gmail dot com.

# # #