কম্পিউটার টিউটোরিয়াল

জাভাস্ক্রিপ্ট Math অবজেক্ট উদাহরণ


জাভাস্ক্রিপ্ট Math অবজেক্ট আমাদের সংখ্যার ওপর গাণিতিক অপারেশন করার অনুমতি দেয়। এতে গাণিতিক কনস্ট্যান্ট এবং ফাংশন 위한 প্রোপার্টি এবং মেথড রয়েছে।

উদাহরণ

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style>    body {       font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;    }    .sample {       font-size: 18px;       font-weight: 500;       color: red;    } </style> </head> <body> <h1>JavaScript Math Object</h1> <div class="sample"></div> <div style="font-weight: bold; color: black;" class="result"></div> <button class="Btn">CLICK HERE</button> <h3> Click on the above button to see some math Object methods </h3> <script>    let sampleEle = document.querySelector(".sample");    document.querySelector(".Btn").addEventListener("click", () => {       sampleEle.innerHTML = 'Math.round(7.7) = ' + Math.round(7.7) + '<br>';       sampleEle.innerHTML += 'Math.sqrt(121) = ' + Math.sqrt(121) + '<br>';       sampleEle.innerHTML += 'Math.pow(4,4) = ' + Math.pow(4,5) + '<br>';    }); </script> </body> </html>

আউটপুট

জাভাস্ক্রিপ্ট Math অবজেক্ট উদাহরণ

'CLICK HERE' বাটনে ক্লিক করলে -

জাভাস্ক্রিপ্ট Math অবজেক্ট উদাহরণ


  1. জাভাস্ক্রিপ্টে Map অবজেক্ট

  2. জাভাস্ক্রিপ্টে Blob অবজেক্ট

  3. জাভাস্ক্রিপ্টে RegExp অবজেক্ট

  4. জাভাস্ক্রিপ্টে অবজেক্ট ইলিশিয়ালাইজার