From 8dcd23dd471a1dffa47c69ad9f92116fadfcec8f Mon Sep 17 00:00:00 2001 From: a-sabagh Date: Sun, 22 Jan 2023 08:30:31 +0330 Subject: [PATCH] change actions periority --- src/App.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index 8edd71f..1595d1d 100644 --- a/src/App.js +++ b/src/App.js @@ -12,15 +12,15 @@ export default class { let panel = document.querySelector('.panel') new Promise((resolve,reject)=>{ const interval = setInterval(()=>{ - panel.innerHTML = counter - counter-- if(counter <= 0){ clearInterval(interval) - panel.innerHTML = '' resolve('done') } + panel.innerHTML = counter + counter-- },1000) }).then((result)=>{ + panel.innerHTML = '' let items = [rock,paper,scissor] let img = document.createElement('img') img.src = items[Math.floor(Math.random()*items.length)]