File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -165,18 +165,18 @@ function sort_nums(arr, reverse = false) {
165165
166166/**
167167 * To get all the elements of an array with given key and value.
168- * More like Where claus in php just for js array
168+ * More like Where clause in php just for js array
169169 *
170170 *
171- * @param array arr
171+ * @param array arr
172172 * @param string key
173173 * @param string value
174174 * @param number value
175175 * @returns array
176176 */
177-
178- function getElementByKeyValue ( arr , key , value ) {
179- return arr . filter ( item => item [ key ] == value )
177+ function get_element_by_key_value ( arr , key , value ) {
178+ is_array ( arr ) ;
179+ return arr . filter ( ( item ) => item [ key ] == value ) ;
180180}
181181
182182export {
@@ -194,5 +194,5 @@ export {
194194 array_sum ,
195195 array_slice_sum ,
196196 sort_nums ,
197- getElementByKeyValue ,
197+ get_element_by_key_value ,
198198} ;
You can’t perform that action at this time.
0 commit comments