I was making a quick note of an interesting point in the video, and I thought I would share it in my own attempt to be more aware of how I type.
Of course, removing characters from a string really does work quite a bit better than removing words from a string. But this can be a bit tricky when you’re trying to remove a string from a string. For instance, “string” is an iterable property of any object and is also a property of this object. If you try to remove the “string” property from the object, you’re actually removing the string value.
This is why removing the string property of the object from the object is a really bad idea. You are going to end up with an object with only one property, and that property is the one you want to keep.
Removing a string from an object is another bad idea, but it is especially bad when you want to remove everything from the object (as opposed to only some of the properties). In this case the string value would be removed from the array, but the array itself will remain intact. For example, because the string value will be removed from the object, you will not be able to access its indexed properties. You should try to be careful about how you do this.
The problem with this code is that if you remove a property of an object, the object itself will have to maintain that property. This means that if you try to delete a property of an object you will also delete the object itself. For example, if you want to remove the property of an object called “name” from the array “person”, then you will need to also remove the object itself, “person”.
For the same reason, if you try to remove a property of an array, you will need to also delete the array. Like the example above, you will have to remove the array itself too.