Property Locale does not exist on type of Intl?

Viewed 945

I'm copying this directly from the MDN Web Docs:

const korean = new Intl.Locale('ko', {
  script: 'Kore',
  region: 'KR',
  hourCycle: 'h24',
  calendar: 'gregory',
});

const japanese = new Intl.Locale('ja-Jpan-JP-u-ca-japanese-hc-h12');

console.log(korean.baseName, japanese.baseName);
// expected output: "ko-Kore-KR" "ja-Jpan-JP"

console.log(korean.hourCycle, japanese.hourCycle);
// expected output: "h24" "h12"

But am getting the aforementioned error: Property 'Locale' does not exist on typeof Intl.

Any ideas why this isn't working?

0 Answers
Related