Is it OK to use "type" as a variable name?

389 Views Asked by At
let type = "HI";

console.log(type)

I know its not a reserved word but its showing in blue color while taking as a variable so got a doubt?

1

There are 1 best solutions below

0
Jagrut Sharma On

Per this documentation, type is not reserved word for now or near future.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar

Note that typeof is reserved word. So, it is a matter of readability and naming conventions that you/your team may follow.