{"comment":{"url":"https://api.github.com/repos/amizony/frontend-javascript-exercises/comments/11278028","html_url":"https://github.com/amizony/frontend-javascript-exercises/commit/aef9401fed61ce557853b4a8cbcc4366632f1003#commitcomment-11278028","id":11278028,"user":{"login":"chikamichi","id":106689,"avatar_url":"https://avatars.githubusercontent.com/u/106689?v=3","gravatar_id":"","url":"https://api.github.com/users/chikamichi","html_url":"https://github.com/chikamichi","followers_url":"https://api.github.com/users/chikamichi/followers","following_url":"https://api.github.com/users/chikamichi/following{/other_user}","gists_url":"https://api.github.com/users/chikamichi/gists{/gist_id}","starred_url":"https://api.github.com/users/chikamichi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chikamichi/subscriptions","organizations_url":"https://api.github.com/users/chikamichi/orgs","repos_url":"https://api.github.com/users/chikamichi/repos","events_url":"https://api.github.com/users/chikamichi/events{/privacy}","received_events_url":"https://api.github.com/users/chikamichi/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"aef9401fed61ce557853b4a8cbcc4366632f1003","created_at":"2015-05-20T07:56:59Z","updated_at":"2015-05-20T07:56:59Z","body":"Following the same idea that boolean operators return `true` or `false`, which is what you want to do with your method, you can leverage them to simplify the implementation:\r\n\r\n``` js\r\nfunction(item, money) {\r\n    // return 'true' if a user can afford a given item according to the price chart below, false otherwise:\r\n    // 'MacBook Air' - $999\r\n    // 'MacBook Pro' - $1299\r\n    // 'Mac Pro' - $2499\r\n    // 'Apple Sticker' - $1\r\n    // return 'false' if the 'item' is not in the above list apple products\r\n    \r\n    // Jean-Denis, let me know if you want this coded with if-then-else. Below is simpler, though.\r\n    return (item == \"MacBook Air\" && money >= 999) ||\r\n      (item == \"MacBook Pro\" && money >=1299) ||\r\n      (item == \"Mac Pro\" && money >=2499) ||\r\n      (item == \"Apple Sticker\" && money >= 1);\r\n}\r\n```"}}