JS - to limit arrays with slice()

0 votes
258 views
added Sep 26, 2022 in Javascript by lcjr First Warrant Officer (11,970 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.
...