Reference · The realistic Earth's pure parts
cityRankfunction
How much a city counts when names crowd: its people, and a bonus for the capital of a country (2 million), another seat of government (1 million) and the capital of a subdivision (100,000).
Import it
import { cityRank } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function cityRank(city: Pick<NamedCity, "population" | "capital">): number
Parameters
| Name | Type | Description |
|---|---|---|
city | Pick<NamedCity, "population" | "capital"> | The city. |
Returns
number
The rank; higher is named first.
Examples
import { cityRank } from "@johnmorrisdotca/chikyu-earth/realistic";
console.log(cityRank({ population: 5_700, capital: "national" }), cityRank({ population: 5_700, capital: null }));2005700 5700What it prints (run when this page was built)