Подскажите пожалуйста как в last_ticker_val можно указать статические число и потом уже сравнивать с ticker_val?
var last_ticker_val = null;
setInterval(function(){
if(document.querySelector(bid_ask_label_selector) !== null){
//console.log(document.querySelector(bid_ask_label_selector).innerHTML);
var ticker_val = document.querySelector(bid_ask_label_selector).innerHTML;
var up = 'up';
var down = 'down';
// console.log(last_ticker_val - ticker_val);
if(minus_diff >= (ticker_val - last_ticker_val)){
chrome.storage.local.set({deal: down}, function() {
//console.log('Value is set to ');
});
}
if((ticker_val - last_ticker_val) >= diff){
chrome.storage.local.set({deal: up}, function() {
//console.log('Value is set to ');
});
}
last_ticker_val = ticker_val;
}
},interval);