i know not to nest functions lol- it was just for an example of encapsulation
encapsulation usually refers to being able to access an object's properties independently of their internal representation/implementation, and/or the bundling of data together with its methods. it's not really about nesting alone