My app.js is written in es6 standard and my question is > How can I use code like this?:
$('img').each(() => {
var title = $(this).attr('src');
titles.push(title);
});
I observed that node compile this code to:
'use strict';
$('img').each(function () {
var title = $(undefined).attr('src');
titles.push(title);
});
compile 'this' to 'undefined', how can I fix that? thx in advance ;)