Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const robot = {
- id: 1,
- skill: null,
- currentWorkPlace: cleaning,
- }
- const warehouse = {
- aiStaff: [],
- currentStatus: 100,
- boxes: null,
- }
- function registerRobot(robot, warehouse) {
- warehouse.aiStaff.push(robot.id);
- robot.currentWorkPlace = warehouse;
- }
- /* When new robots get into the warehouse, a lot of routine work is done, first you need to make an entry in the inventory log, then change the robot settings so that he knows his place of work and much more. Let's start by automating the process of registering robots in the warehouse? Write the registerRobot function, which takes two objects robot and warehouse.
- Scheme of objects:
- robot {
- id
- skill
- currentWorkPlace
- }
- warehouse {
- aiStaff
- currentStatus
- boxes
- }
- The function should add the id of the new robot to the array aiStaff, and for the robot object write a reference to the object warehouse to currentWorkPlace. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement