JS - to limit arrays with slice()

0 votes
51 views
added Sep 26 in Javascript by lcjr First Warrant Officer (9,190 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.
...