Skip to content

Commit b57c08c

Browse files
author
Walle Cyril
authored
Object.assign typo fixed
1 parent eb64eab commit b57c08c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

js/Object.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ anObject = {
2222
anObject["key"] = "value";
2323

2424
// assign multiple
25-
Object.assing(anObject, {
25+
Object.assign(anObject, {
2626
"key1": "value1",
2727
"key2": "value2"
2828
});
@@ -55,6 +55,7 @@ Object.entries(anObject).forEach(function ([key, value]) {
5555
anObject.hasOwnProperty("key");
5656

5757
// has safe, works even when anObject has a key "hasOwnProperty"
58+
// alsow works for Objects without prototype
5859
Object.prototype.hasOwnProperty.call(anObject, "key");
5960

6061
// remove a value

0 commit comments

Comments
 (0)