Programming OOP in Javascript - Properly

后端 未结 6 1452
旧时难觅i
旧时难觅i 2021-02-06 10:46

I\'m interesting in improving my javascript code to be properly OOP.... currently I tend to do something like this:

jQuery(document).ready(function () {
    Page         


        
6条回答
  •  猫巷女王i
    2021-02-06 11:19

    There isn't one correct way... Some people use a framework to define their object, I like to just extend prototype directly. Anyhow, I wanted to say that Oran Looney has some good posts on OO mechanics in JS:

    http://oranlooney.com/classes-and-objects-javascript/

    Its also worth looking at his other articles:

    http://oranlooney.com/deep-copy-javascript/ http://oranlooney.com/functional-javascript/

提交回复
热议问题