Sai
Sai

Reputation: 91

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

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?

Upvotes: 0

Views: 671

Answers (1)

Jagrut Sharma
Jagrut Sharma

Reputation: 4754

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.

Upvotes: 1

Related Questions