Jquery function .data

0

Can someone clarify or explain to me the difference between these two situations

$.data(this, 'timer')

Or

$(this).data('timer');
    
asked by anonymous 07.09.2017 / 19:37

1 answer

0
They do the same thing. JQuery allows you to do the same thing in different ways, this is a good example of this.

The documentation confirms this:

  

Note: This is a low-level method; more convenient .data() is also available.

     

Note: This is a low-level method; a more convenient .data() also exists.

    
07.09.2017 / 19:40