You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2019-11-28-Commonly used JavaScript functions.markdown
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,16 @@ Following methods are used for filtering and transforming an array.
51
51
-[splice()][Array.prototype.splice()] - This method modifies the contents of the array by adding or removing new elements in-place.
52
52
-[join()][Array.prototype.join()] - This method is the opposite of [String.prototype.split()][String.prototype.split()]. It creates and returns a new string by concatenating all array elements, separating them by a specified separator string.
53
53
54
+
## Object methods
55
+
Following are some of the common methods from the [Object][Object] global object.
56
+
57
+
-[keys()][Object.keys()] - This method returns an array of a given object's own enumerable property names, in the same order as we get with a normal loop.
58
+
-[values()][Object.values()] - This method returns an array of a given object's own enumerable property values, in the same order as that provided by a [for...in][for...in] loop.
59
+
-[entries()][Object.entries()] - This method returns an array of a given object's own enumerable string-keyed property `[key, value]` pairs, in the same order as that provided by a [for...in][for...in] loop.
60
+
-[fromEntries()][Object.fromEntries()] - This method is the opposite of `Object.entries()`. It transforms a list of key-value pairs into an object.
61
+
62
+
One of the best ways to learn more these methods is to click on their links, read the documentation, and play around with some examples.
0 commit comments