Posts

Showing posts from 2016

JavaScript module pattern and "new" keyword

It is an old post based on old idea, it is not so relevant anymore.   I have just encountered an article about JavaScript module pattern. As a Java developer, it blows my thinking about JavaScript. So far, it is the excellent article about JavaScript module pattern, according to my point of view. I added the link of the article for me and who wants to learn module pattern. https://toddmotto.com/mastering-the-module-pattern/ However, the self invoked function creates only one object in the memory. As a Java developer, it looks like Java singleton or static method kind of thing. You cannot create multiple objects using self invoked function. In this post, I am trying to demonstrate the situation step by step using simple example and potential solution of this issue.  For example: var Name = (function(){ var firstName = "Ted"; var lastName = "Bid"; var nameObject = {}; nameObject.setFirstName = function(fn){ ...

WGET: Downloading an Entire Web Site

I like to read online tutorial very much. Sometime, I would like to download whole site to view offline because tomorrow, the entire site may be down.  In Linux, it is very easy. Using wget command anyone can download whole site and it is very fast also.    $ wget --recursive www.website.com