Skip to content

Tag Archives: JavaScript-Methods

Below is the example of Array reverse() method. Example: <script> function func() {        // Original Array     var arr = ['Portal', 'Science',                 'Computer', 'GeeksforGeeks'];     document.write(arr);… Read More
Below is the example of Array sort() method. Program 1: <script> // JavaScript to illustrate sort() function function func() {        // Original string     var… Read More
Below is the example of Array pop() method. Example: <script>     function func() {         var arr = ['GFG', 'gfg', 'g4g', 'GeeksforGeeks'];                // Popping the last… Read More
Below is the example of Array push() method. Example: <script>      function func() {          var arr = ['GFG', 'gfg', 'g4g'];                 // Pushing the element into… Read More
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: <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:   javascript <script type="text/javascript">          document.write("When 1 is  passed as a parameter: "                         + Math.acos(1)); </script>… Read More
Below is the example of the Math cos() Method. Example: <script type="text/javascript">          document.write("The cos of 0 : " + Math.cos(0)); </script> Output: The cos of… 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