@@ -26,7 +26,7 @@ import {
26
26
object_to_array ,
27
27
search_in_array ,
28
28
sanitize_array ,
29
- get_rms_value ,
29
+ get_rms_value ,
30
30
} from " @hetarth02/js-array-helpers" ;
31
31
32
32
let arr = [1 , 2 ];
@@ -67,7 +67,8 @@ const my_schema = {
67
67
console .log (sanitize_array (my_array, my_schema));
68
68
69
69
// Sanitized Output
70
- // [ { name: 'sam', age: 0, isEmployed: false },
70
+ // [
71
+ // { name: 'sam', age: 0, isEmployed: false },
71
72
// { name: 'a', age: 456, isEmployed: false },
72
73
// { name: 'c', age: 0, isEmployed: true },
73
74
// { name: 'null', age: 123, isEmployed: true },
@@ -77,36 +78,18 @@ console.log(sanitize_array(my_array, my_schema));
77
78
// ]
78
79
79
80
// get_rms_value example
80
-
81
- // Given array of numbers
82
81
const values = [23 , 54 , 19 ];
82
+ console .log (get_rms_value (values)); // 35.61834733205159
83
83
84
- // Run get_rms_value with array
85
- console .log (get_rms_value (values))
86
-
87
- // Calculated Root Mean Square value
88
- // 35.61834733205159
89
-
90
- // to reverse an array in parts
84
+ // To reverse an array in parts
91
85
let my_array = [1 , 2 , 3 , 4 , 5 ];
92
86
let reverseInPart_array = array_reverse_part (my_array, 3 , 4 );
93
87
94
- console .log (reverseInPart_array);
88
+ console .log (reverseInPart_array); // [1, 2, 3, 5, 4]
95
89
96
- // output
97
- // rotated_array=[1,2,3,5,4];
98
-
99
- // to rotate array counter clockwise
90
+ // To rotate array counter clockwise
100
91
let my_array1 = [1 , 2 , 3 , 4 , 5 ];
101
92
let rotated_array = array_rotate (my_array1, 3 );
102
93
103
- console .log (rotated_array);
104
-
105
- // output
106
- // rotated_array=[4,5,1,2,3];
107
-
108
- // equilibrium_point program file execution
109
- // Array = [1,3,5,2,2]
110
- // n=5
111
- // output = 3
94
+ console .log (rotated_array); // [4, 5, 1, 2, 3]
112
95
```
0 commit comments