Loading topic
Object.keys, Object.values, or Object.entries, you don't get every property the object can reach. You get a filtered set: the object's own, enumerable, string-keyed properties. This chapter explains what each of those three words means, so the late3 min readfor...of loop. It also assumes you have read the previous chapter on own enumerable properties. Here you learn the most basic way to loop over a plain object: 2 min readfor...of, and the array methods reduce, some, and every. It also assumes you have read the previous chapter on Object.keys, because Object.values follows the same rules about which properties it includes.2 min readfor...of loop. It also assumes you have read the earlier chapters on own enumerable properties and Object.keys.2 min readconst and let, write object literals, and use for...of over arrays. It also assumes you have read the previous chapter, where Object.entries turned an object into an array of [key, value] pairs. Here you learn to unpack those pair2 min readforEach, map, filter, and reduce. It also builds on the earlier chapters about Object.keys, Object.values, and Object.entries.3 min readfor...of loops, and the idea of own enumerable properties from earlier chapters. It also assumes you have seen that objects can inherit from a prototype. JavaScript has an older way to loop over an object's properties: the for...in statement. It loo3 min readObject.keys and Object.entries, how for...of works, and how to read bracket-notation property access. Here the question is narrower. When you loop over an object, which key comes first?3 min readObject.entries returns [key, value] pairs and how to destructure those pairs inside map and filter callbacks. Here you go one step further and turn the pairs back into an object.2 min readObject.keys and Object.entries loop over an object's own enumerable string-keyed properties, and that you can read object literals that use computed keys such as [id]: 7. In this chapter you look at the two kinds of own property those methods leave out2 min readObject.keys, Object.values, and Object.entries behave on plain objects, and that you are comfortable with try...catch and the ?? operator. Here you will see what these methods do when the value you pass in is not a plain object. That happens more o3 min readObject.keys and Object.entries return arrays, how to destructure [key, value] pairs in a for...of loop, and how for...in differs from Object.keys. The question here is narrow: what happens when the loop body changes the object you are looping over?3 min read