Skip to content

Instantly share code, notes, and snippets.

@paveltar
paveltar / seatsMapping.js
Last active April 14, 2018 06:10
Plane seats price mapping
// row must be [bool, bool, bool] ex: [false,0,1], [0,1,0], [1,true,0] etc...
priceMapping = (value, index, array) => {
if (value) {
if (array[index + 1] || array[index - 1]) {
return 200
}
return 100;
}
return 0;
}