Food-Static-Data / sd

Food static data wrapper
GNU General Public License v3.0
9 stars 14 forks source link

display data that created Elnur and Wahaj #236

Open vadim9999 opened 5 years ago

vadim9999 commented 5 years ago
  1. Create folder play and file paly.js there.
  2. In play.js import files that you have added from filesObjects.js https://github.com/GroceriStar/sd/blob/master/filesObjects.js To import from filesObjects.js you need to use this import
    const staticData = require("../../filesObjects")
    // to get access to allergies use staticData.dash

    staticData contains data of all files that is stored in src/data. staticData is array that contains all objects. Object contains property name - filename, value - object that was got from file. staticData.dash returns object. dash is a value of property dash

  3. Create loop that will display in console.log objects.
elnur004 commented 5 years ago

@vadim9999 hi, actually, i don't understand this task clearly

vadim9999 commented 5 years ago

@elnur004 Hi, I will push some changes after 5 minutes and explain how to do

vadim9999 commented 5 years ago

@elnur004 Ok, in play js delete all imports make it empty. Then with using require import from filesObjects.js. Create function that will be displaying in loop all objects in console.log. you can use forEach, map, or other

vadim9999 commented 5 years ago

@elnur004 please look on this task. I have updated it

elnur004 commented 5 years ago

@vadim9999 this syntax in filesObjects.js confuses me arr = { ...arr,

what is this meaning? especially 3 dots

atherdon commented 5 years ago

http://es6-features.org/#SpreadOperator https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax

vadim9999 commented 5 years ago

@elnur004

http://es6-features.org/#SpreadOperator https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax

vadim9999 commented 5 years ago

I see this task is stuck

vadim9999 commented 5 years ago

@elnur004 What help do you need that you will complete this task?

vadim9999 commented 5 years ago

@elnur004 The first stage was done. Your goal here create a function that will be displaying all objects. As you see when you display two objects using the same function forEach(). Think up how to separate it with one function.