JavaScript Inheritance and Object Programming

Coding Tutorial, Chapter 3b

Using Object Programming: A get_ps_styles() Function

© 18 July, 2013, Martin Rinehart


Results

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

Code

We put inner functions at the end of their outer functions. If the inner functions are written with function declaration statements (function foo() {...}) they will be hoisted, so can be used before they appear in the source. This leads to cleaner outer functions, main logic preceding helper functions.

A single test is shown.

Feedback: Martin Rinehart at gmail dot com.

# # #