When to Encapsulate in javascript?

<p>I have been developing websites using jQuery for 3 years now and I've recently gained interest in OOP in Javascript and I'm still starting to get my hands on OOP.</p><p>I read from this <a href="http://ift.tt/147bhlO" rel="nofollow">article</a>, and it says:</p><blockquote><p>Encapsulation ...(its methods and properties) are hidden from the rest of the application.</p></blockquote><p>but why would you wanna take the extra time to do that? When you are the programmer and you know you aren't gonna use that on another object anyway. Am I missing something imoportant here? I don't really see any need to do this on my current experiences. So when exactly to Encapsulate in Javascript?</p><br /><h2>Click here view more answers <a href="http://ift.tt/1oEilDS">http://ift.tt/1oEilDS</a></h2>

Nhận xét

Bài đăng phổ biến từ blog này

Align div to bottom of the page in bootstrap

Align elements inside an tag vertically

Javascript is unable to stop page loading