Reference · Japanese addresses
getPostalPrefixesForPrefecturefunction
The three-digit postal prefixes a prefecture's codes begin with, the reverse of
getPrefectureFromJapanesePostalCode. A prefix on a border is listed under the prefecture most of its codes belong
to.
Import it
import { getPostalPrefixesForPrefecture } from "@johnmorrisdotca/address-plus/jp";
Also exported from: @johnmorrisdotca/address-plus
Definition
function getPostalPrefixesForPrefecture(prefecture: string): string[]
Parameters
| Name | Type | Description |
|---|---|---|
prefecture | string | The prefecture, by JIS code, name or romaji, as |
Returns
string[]
The prefixes in ascending order, an empty array for an unknown prefecture.
Examples
import { getPostalPrefixesForPrefecture } from "@johnmorrisdotca/address-plus/jp";
console.log(getPostalPrefixesForPrefecture("沖縄県"));
// → ["900","901","902","903","904","905","906","907"][
'900', '901',
'902', '903',
'904', '905',
'906', '907'
]What it prints (run when this page was built)