@@ -26,7 +26,7 @@ import {
2626 object_to_array ,
2727 search_in_array ,
2828 sanitize_array ,
29- get_rms_value ,
29+ get_rms_value ,
3030} from " @hetarth02/js-array-helpers" ;
3131
3232let arr = [1 , 2 ];
@@ -67,7 +67,8 @@ const my_schema = {
6767console .log (sanitize_array (my_array, my_schema));
6868
6969// Sanitized Output
70- // [ { name: 'sam', age: 0, isEmployed: false },
70+ // [
71+ // { name: 'sam', age: 0, isEmployed: false },
7172// { name: 'a', age: 456, isEmployed: false },
7273// { name: 'c', age: 0, isEmployed: true },
7374// { name: 'null', age: 123, isEmployed: true },
@@ -77,36 +78,18 @@ console.log(sanitize_array(my_array, my_schema));
7778// ]
7879
7980// get_rms_value example
80-
81- // Given array of numbers
8281const values = [23 , 54 , 19 ];
82+ console .log (get_rms_value (values)); // 35.61834733205159
8383
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
9185let my_array = [1 , 2 , 3 , 4 , 5 ];
9286let reverseInPart_array = array_reverse_part (my_array, 3 , 4 );
9387
94- console .log (reverseInPart_array);
88+ console .log (reverseInPart_array); // [1, 2, 3, 5, 4]
9589
96- // output
97- // rotated_array=[1,2,3,5,4];
98-
99- // to rotate array counter clockwise
90+ // To rotate array counter clockwise
10091let my_array1 = [1 , 2 , 3 , 4 , 5 ];
10192let rotated_array = array_rotate (my_array1, 3 );
10293
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]
11295```
0 commit comments