-3

I came across this code at school

var CAR = ' |8|9|10|11|12|13|15|16|';

I understand that this is a variable named car, but I don't understand how it's being initialized or what it means.

Brad
  • 152,561
  • 47
  • 332
  • 504
Uriah
  • 13
  • 3

2 Answers2

2

It's a pipe | character, and in your case it has absolutely no meaning. You have a string literal, and the text is literally |8|9|10|11|12|13|15|16|.

Brad
  • 152,561
  • 47
  • 332
  • 504
1

It's a bitwise OR when used outside the context of a string. In your case, it's inside a string, so it's probably being used somewhere else in the code as a delimiter of numeric values. ie - 8,9,10,etc.

Steve Danner
  • 21,452
  • 7
  • 39
  • 51