initial logic

This commit is contained in:
Pavak Paul 2022-08-29 03:29:12 +05:30
parent 961cb51a9d
commit 8e74563350

27
printFollowerCount.js Normal file
View File

@ -0,0 +1,27 @@
// i85zmo3j i85zmo3j
let followerClass = prompt('Enter the class for followers')
console.log(followerClass)
function getfollowers() {
return document.querySelectorAll(`.${followerClass}`).length
}
function scrollAndGetFollowers() {
window.scrollTo(0, document.body.scrollHeight);
return getfollowers();
}
// setTimeout(() => { scrollAndGetFollowers() }, 2000);
let continuePrinting = true;
document.addEventListener('keydown', function(e) {
if (e.key=="s") {
continuePrinting = false;
}
})
setInterval(() => {
console.log(`This user has ${scrollAndGetFollowers()} followers!`)
}, 10000);