I am working through Knockoutjs tutorial. And one thing seems weird to me. I am currently in part 2:
http://learn.knockoutjs.com/#/?tutorial=collections
And in this part in every "class", "this" is being assigned to "self".. it was not the case in the first one?
Why would someone do this? Is it just whoever wrote that particular code has python addiction, or is there some actual benefits to this?
KnockoutJS is basically a library written in JavaScript, based on MVVM pattern that helps developers build rich and responsive websites.
It is very easy to use KnockoutJS. Simply refer the JavaScript file using <script> tag in HTML pages. A page as in the following image will be displayed. Click on download link and you will get the latest knockout.
Since "this" refers to different objects depending on context, one can save a reference to a particular object by assigning it to another variable, for example "self".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With