ljharb on master
[eslint config] [base] [patch] … [eslint config] [patch] extend … Merge pull request #1996 from r… (compare)
ljharb on master
[editorial] [react] fix typo [eslint config] [*] [deps] upda… (compare)
function trackUserHandler() {
navigator.geolocation.getCurrentPosition(
(position) => {
setTimeout(() => {
console.log('Position ', position);
}, 2000);
},
(error) => console.log(error)
);
/**
* This line will run before we print
* current position or throw an error
*/
setTimeout(() => {
console.log('Timer done');
}, 1000);
console.log('Getting position');
}
button.addEventListener('click', trackUserHandler);
Getting position
will be executed immediately
Hi all, how to check price2 > price1 using for loop? I have used array.push to store values but array values showing undefined.
expected
price 2 > price 1
price 3 > price 2
price 4 > price 3
cy.get(orderCard).find('.kbbrUi').then(listing => {
const listcount = Cypress.$(listing).length;
console.log('count', listcount);
var price_array = [];
for (var i = 1; i < listcount; i++) {
cy.get(orderValue).eq(i).invoke('text').then((label2) => {
const price = label2.replace(/[$]+/g, '');
//const price_2_int = parseInt(price_2);
console.log('price_2_int', price);
price_array.push(price);
})
}
for (var j = 0; j <= price_array.length; j++) {
for (var k = 1; k < j; k++) {
expect(price_array[k]).to.be.greaterThan(price_array[j])
}
}
})
.map
over the list, and get an array of promises, and Promise.all it