prettier/tests/flow/arrays/numeric_elem.js

8 lines
183 B
JavaScript

var arr = [];
var day = new Date;
// Date instances are numeric (see Flow_js.numeric) and thus can index into
// arrays.
arr[day] = 0;
(arr[day]: string); // error: number ~> string