JavaScript Inheritance and Object Programming

Coding Tutorial, Chapter 3a

Object Programming: Object to String

© 18 July, 2013, Martin Rinehart


Results

Use alert()s (or console.log()s) to test your new function.

Code

In a mixed script we put library functions at the top, class code in the middle and mainline at the bottom. You'll want the library functions at the top if your class code uses these functions. (And why else would you have them?) Mainline at the bottom is often the only choice as anonymous functions assigned to vars (ns.foo = function ...) are not hoisted.

A single test is shown.

Feedback: Martin Rinehart at gmail dot com.

# # #