Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var blinds = [
- {
- "round": 1,
- "duration":20,
- "break":0
- },
- {
- "round": 2,
- "duration":20,
- "break":0
- },
- {
- "round": 3,
- "duration":20,
- "break":0
- },
- {
- "round": 4,
- "duration":20,
- "break":20 //break here
- },
- {
- "round": 5,
- "duration":20,
- "break":0
- },
- {
- "round": 6,
- "duration":20,
- "break":0
- },
- {
- "round": 7,
- "duration":20,
- "break":20 //other break
- }
- ];
- blinds.map(function (item) {
- item.duration = item.duration * 60; //convert to seconds
- return item;
- }).filter(function (item) {
- return item.round >= 2
- }).reduce(function (ac, item) {
- console.log(item)
- return ac;
- }, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement