Skip to content

and
@localizer/format 1.1.1

The and formats a list of elements by joining them with the word "and," creating a natural and readable output. It is particularly useful for generating human-friendly text from arrays of localized strings or other elements.

Usage

typescript
import { 
loc
} from '@localizer/core';
import {
and
} from '@localizer/format';
const
values
= [
loc
`A`,
loc
`B`,
loc
`C`,
loc
`D`];
const
result
=
and
(
values
);

Demo

LocaleLocalized value
en-US  American EnglishA, B, C, and D
fr-FR  French (France)A, B, C et D
de-DE  German (Germany)A, B, C und D
fi-FI  Finnish (Finland)A, B, C ja D
sv-FI  Swedish (Finland)A, B, C och D
ko-KR  Korean (South Korea)A, B, C 및 D
hi-IN  Hindi (India)A, B, C, और D

See also