var body = $("html, body");
body.stop().animate({scrollTop:0}, 500, 'swing', function() {
alert("Finished animating");
});
function validBraces(b){
let reg = /\(\)/g;
b = b.replace(/[^\(\)]/g,'')
return b.match(reg) != null ? validBraces(b.replace(reg,'')) : b === "" ? true : false;
}
console.log(validBraces("(Sensei saysno) (sd) (sdfsf"));