Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. let apple = {
  2. ingredient: {
  3. carbohydrate: 1,
  4. flavour: 2
  5. }
  6. };
  7.  
  8.  
  9. if (command === 'prepare') {
  10. let recipe = currentCommand[1];
  11. let quantity = Number(currentCommand[2]);
  12.  
  13. if (recipe === 'apple') {
  14.  
  15. var properties = Object.keys(apple.ingredient);
  16.  
  17. for (let j = 0; j < properties.length; j++) {
  18. let currentProperty = properties[j];
  19. let number = Object.value(apple.ingredient[currentProperty]);
  20. console.log(number);
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement