This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo() | |
.then(function(res) { | |
console.log('inside then 1: ' + res); | |
bar(); | |
}) | |
.then(function(res) { | |
console.log('inside then 2: ' + res); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo() | |
.then(bar()) | |
.then(function(res) { | |
console.log('inside then 2: ' + res); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo() | |
.then(function(res) { | |
console.log('inside then 1: ' + res); | |
return bar(); | |
}) | |
.then(function(res) { | |
console.log('inside then 2: ' + res); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo() { | |
console.log('foo'); | |
return new Promise(resolve => { | |
console.log('foo timeout before'); | |
setTimeout(() => { | |
console.log('foo timeout'); | |
resolve('foo resolved'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1 | |
foo() | |
.then(function(res) { | |
return bar(); | |
}); | |
// 2 | |
foo() | |
.then(bar); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('.item-word-progress').forEach(item => { | |
// show "Reset" button | |
item.click(); | |
// click "Reset button" | |
document.querySelector('[data-tooltip="Reset the word status. It will show up during all the training sessions."]').click(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let MIN_RATING = 6.7; | |
let MIN_VOICES = 20000; | |
let movies = document.querySelectorAll('.premier_item'); | |
[...movies].forEach((movie, index) => { | |
const ratingBlock = movie.querySelector('.ajax_rating'); | |
const ratingElem = ratingBlock.querySelector('u'); | |
const voicesElem = ratingBlock.querySelector('b'); |