Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- make an REST API endpoint using nodejs (any framework) that will recieve an integer param. And the response should be a JSON with string of number from 1 until input that separated by comma.
- but for each multiple of 3, it will concat "Pesta" instead of the number.
- but for each multiple of 7, it will concat "Diskon" instead of the number.
- and for each multipleof of both 3 and 7, it will concat "PestaDiskon" instead of the number
- example:
- input:
- cURL http://localhost:3000/test/23
- response:
- {
- output:"1,2,Pesta,4,5,Pesta,Diskon,8,Pesta,10,11,Pesta,13,Diskon,Pesta,16,17,Pesta,19,20,PestaDiskon,22,23,"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement