Last active
April 23, 2019 17:36
-
-
Save shisama/d10e13474bb4a035f59f992d166be7f5 to your computer and use it in GitHub Desktop.
Intl.ListFormat - New JavaScript Features in Node.js v12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const vehicles = ['Motorcycle', 'Bus', 'Car']; | |
{ | |
const formatter = new Intl.ListFormat('ja', { style: 'long', type: 'conjunction' }); | |
console.log(formatter.format(vehicles)); | |
// expected output: "Motorcycle、Bus、Car" | |
} | |
{ | |
const formatter = new Intl.ListFormat('en', { style: 'long', type: 'conjunction' }); | |
console.log(formatter.format(vehicles)); | |
// expected output: "Motorcycle, Bus, and Car" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment