Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit af2d42a

Browse files
committedDec 31, 2020
Use toString instead of + '' to convert types
1 parent c1c5af2 commit af2d42a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎JavaScript/4-has.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const person = new Proxy(data, {
1212
if (key === 'age') {
1313
return (
1414
new Date().getFullYear() -
15-
new Date(obj.born + '').getFullYear()
15+
new Date(obj.born.toString()).getFullYear()
1616
);
1717
}
1818
return obj[key];

0 commit comments

Comments
 (0)
Please sign in to comment.