Skip to content

Commit 3109d6d

Browse files
Update exemplar.js
1 parent d501307 commit 3109d6d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

exercises/concept/assembly-line/.meta/exemplar.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function isEmptyArray(value) {
7878
}
7979

8080
/**
81-
* Throws an error if an object is missing an "id" property.
81+
* Throws an error if an object is missing an "id" property or method.
8282
*
8383
* @param {object} object
8484
* @returns {boolean} undefined if the input has an "id" property, otherwise throws an error.
@@ -91,7 +91,7 @@ export function assertHasId(object) {
9191
}
9292

9393
/**
94-
* Checks if a value has a "type" property.
94+
* Checks if a value has a "type" property or method.
9595
*
9696
* @param {object} object
9797
* @returns {boolean} whether the input has a "type" property.
@@ -101,13 +101,13 @@ export function hasType(object) {
101101
}
102102

103103
/**
104-
* Checks if a value has a "constructor" property.
104+
* Checks if a value has a "id" property.
105105
*
106106
* @param {object} object
107-
* @returns {boolean} whether the input has a "constructor" property.
107+
* @returns {boolean} whether the input has a "id" property.
108108
*/
109109
export function hasConstructorProperty(object) {
110-
return Object.hasOwn(object,"constructor")
110+
return Object.hasOwn(object,"id")
111111
}
112112

113113
/**
@@ -117,5 +117,5 @@ export function hasConstructorProperty(object) {
117117
* @returns {boolean} whether the input has a defined "type" property.
118118
*/
119119
export function hasDefinedType(object) {
120-
return hasType(object) && object.type !== undefined
120+
return Object.hasOwn(object, "type") && object.type !== undefined
121121
}

0 commit comments

Comments
 (0)