Skip to content

Tag Archives: JavaScript-Methods

Below is the example of the Array forEach() method. Example: <script>     // JavaScript to illustrate forEach() method     function func() {                // Original array         const… Read More
Below is the example of the Array lastIndexOf() method.   Example:   javascript <script>     var name = [ 'gfg', 'cse', 'geeks', 'portal' ];       a = name.lastIndexOf('gfg')… Read More
Below is the example of Array slice() method. Example: <script> function func() {        // Original Array     var arr = [23,56,87,32,75,13];        // Extracted array… Read More
Below is the example of Array unshift() method. Example: <script> function func() {             // Original array      var array = ["GFG", "Geeks", "for", "Geeks"];    … Read More
Below is the example of the Math asin( ) Method. Example: <script type="text/javascript">    document.write("When 1 is  passed as a parameter: "                   + Math.asin(1)); </script> Output:… Read More
Below is the example of the Math acos( ) Method. Example: <script type="text/javascript">          document.write("When 1 is  passed as a parameter: "                          + Math.acos(1)); </script> Output:… Read More
Below is the example of the Math cos() Method.   Example:   html <script type="text/javascript">          document.write("The cos of 0 : " + Math.cos(0)); </script> Output:   The cos… Read More
Below is the example of the Math tan() Method.  Example:  Javascript <script type="text/javascript">     document.write("When  zero is  passed as a parameter: "        + Math.tan(0)); </script> Output: … Read More
Below is the example of the Math ceil() Method. Example: <script type="text/javascript">          document.write("Result : " + Math.ceil(.89)); </script> Output: Result : 1 The Math.ceil method… Read More
Below is the example of the Math sin() Method. Example: <script type="text/javascript">       document.write("When zero is  passed as a parameter: "                       + Math.sin(0)); </script> Output: When… Read More
Below is the example of the Math min() Method. Example: <script type="text/javascript">      document.write("When  positive numbers are passed"+                     " as parameters: " + Math.min(10, 32, 2));… Read More
Below is the example of the Math max() method.   Example:   javascript <script type="text/javascript">      document.write("When  positive numbers are passed"+                     " as parameters: " + Math.max(10, 32,… Read More
Below is the example of the Math pow() Method. Example: <script type="text/javascript">     document.write(Math.pow(3, 4)); </script> Output: 81 The Math.pow() method is used to power of… Read More
Below is the example of the Math trunc() Method. Example: When a positive float number passed as a parameter <script type="text/javascript">          document.write(Math.trunc(15.56));          </script> Output: 15… Read More
Below is the example of the Math log() Method. Example: <script type="text/javascript">      document.write("When zero is  passed as a parameter: "                       + Math.log(0)); </script> Output: When… Read More

Start Your Coding Journey Now!