JS - to limit arrays with slice()

0 votes
303 views
added Sep 26, 2022 in Javascript by lcjr Lieutenant (12,120 points)
let coworkAmenities = get(data, 'field_prop_additional_amenities', '');
coworkAmenities = coworkAmenities.slice(0, 4);

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...