[JavaScript-數學類]使用絕對值函數-使用Math.abs()

說明:
求絕對值

程式:
       <script type="text/javascript">
document.write("1的絕對值:"+Math.abs(1)+"<br>");
document.write("-1的絕對值:"+Math.abs(-1)+"<br>");
</script>

結果:



圖:









 















其它文章

arrow
arrow

    PG Levin Li 發表在 痞客邦 留言(0) 人氣()