Understanding the $ volume hierarchy in AngularJS?

When I create an object and navigate through its _proto__ property, I find out that it was inherited from Object

enter image description here

Now, when I create a new object and inherit the obj object, I get the inheritance structure as follows enter image description here

Here I can understand that obj1 is inherited from obj, and obj is inherited from Object, which is a global object.

Now my question is: when I debug in my console, I get both obj and obj1 as Object, but when I debug $ scope of angleularJS, I get something like this

enter image description here

Why the $ variable returns b instead of Object, which can be seen in all two images above, which is so different in angularJS, I am missing something.

UPDATE 1

javascript, ,

enter image description here

$scope -, ? - , ,

+4
2

, -.

$scope - Scope ChildScope .

Angular - b.

+2

, , :

function Scope() {}
var s = new Scope();

enter image description here

function Scope() {} - : function b() {} new b() new Scope()

+1

Source: https://habr.com/ru/post/1663964/


All Articles