//Sample solution for script.js
//Note: code exists prior to this point
function percentToWidth(percent,maxWidth) {
var out = (percent/100)*maxWidth;
if(isNaN(percent)){
return 0;
} else if(percent<0) {
return 0;
} else if(percent>100){
return maxWidth;
} else {
return out;
}
}
//Note: code exists after to this point
No comments:
Post a Comment