It’s the homework for Skillfactory course PHPPRO. The module is 19 (Working with advanced objects in JavaScript).
If you’d like to see tasks from lesson 19.3 and 19.4 separately, here you go:
The task files are named with the format
task-<number>-<lesson>.js
where <number> is the task number (example: 4), while <lesson> is the lesson number (example: 19.4).
This format helps you easily find the necessary file without needing to look at every.
Write a function that takes an object as an argument and prints to the console all the keys and values of only its own properties. This function should not return a value.
Write a function that takes a string and an object as arguments, and then checks whether the passed object has a property with the given name. The function must return true or false.
Write a function that creates an empty object, but without a prototype.
Implement the following console application similar to the example discussed in the video. Implement it on prototypes.
Define the hierarchy of electrical appliances. Plug some in. Calculate power consumption (pass argument).
There should be at least two such devices (for example, a table lamp and a computer). When choosing a device, think about what properties it has.
Rewrite the console application from the previous lesson into classes.