Skip to content

Instantly share code, notes, and snippets.

@piq9117
Created August 12, 2016 01:02
Show Gist options
  • Save piq9117/01507ac41635f30ab0aa8411e41f7110 to your computer and use it in GitHub Desktop.
Save piq9117/01507ac41635f30ab0aa8411e41f7110 to your computer and use it in GitHub Desktop.
'use strict';
const R = require('ramda');
const activityDetails = [
{
id: '395478',
title: 'Unique Warner Bros. Studio Tour London – The Making of Harry Potter',
imageUrl: '//a.travel-assets.com/lxweb/media-vault/395478_m.jpeg?v=102150',
largeImageURL: '//a.travel-assets.com/lxweb/media-vault/395478_l.jpeg?v=102150',
fromPrice: '$151',
fromPriceLabel: 'per adult',
fromOriginalPrice: '$168',
fromOriginalPriceValue: '167.32',
duration: '5h',
fromPriceTicketType: 'adult',
freeCancellation: true,
discountPercentage: '10',
categories: [
'Attractions',
'Tours & Sightseeing'
],
latLng: '51.6904732,-0.4127882',
redemptionType: 'Voucherless',
supplierName: 'City Wonders Limited',
recommendationScore: 96,
discountType: null,
shortDescription: null
}
];
function getPrice (act) {
return act.fromPrice.substring(1);
}
const fromPrice = R.map(getPrice, activityDetails);
console.log(parseInt(fromPrice));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment