---
title: "Comment by fengxh on \"Why you shouldn't use Double Equals Operator in JavaScript\" | Hashnode"
description: "Sometimes, the type of data which are retrieved from apis is bitter vague, such as { code: 2, name: &#39;fengxh&#39;, type: &#39;human&#39; } or { code: &#39;2&"
url: "https://hashnode.com/posts/lose-equality-and-strict-equality-in-javascript/5f4f5b5af6e5c425ea6960fe/comment/5f50a7fe98ae9829ac3dabda"
---

[Discussion](https://hashnode.com/posts/lose-equality-and-strict-equality-in-javascript/5f4f5b5af6e5c425ea6960fe)

Comment [Why you shouldn't use Double Equals Operator in JavaScript](https://hashnode.com/posts/lose-equality-and-strict-equality-in-javascript/5f4f5b5af6e5c425ea6960fe)

[fengxh](https://hashnode.com/@fengxh)

[Sep 3, 2020](https://hashnode.com/posts/lose-equality-and-strict-equality-in-javascript/5f4f5b5af6e5c425ea6960fe/comment/5f50a7fe98ae9829ac3dabda)

Sometimes, the type of data which are retrieved from apis is bitter vague, such as { code: 2, name: 'fengxh', type: 'human' } or { code: '2', type: 'clothes' }, from two different apis. So more codes to directly use `===`, unless a workaround `+code === 2`. But I still recommend using `===`
