Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular terminology - Hash object

I'm reading through AngularJS developer guidelines, and although I'm not so new to JavaScript, and although Google talks down to developers I don't understand some portions of the documentation.

Namely, I don't understand what hash object is. I thought I knew what object hash was, but they use it differently. I'll put few quotes to illustrate:

About scope parameter of $compile function

If set to {} (object hash), then a new "isolate" scope is created

The 'isolate' scope takes an object hash which defines a set of local scope properties derived from the parent scope. These local properties are useful for aliasing values for templates. Locals definition is a hash of local scope property to its source:

Talking about link function for creationg of directives

attrs is a hash object with key-value pairs of normalized attribute names and their corresponding attribute values

  • What is a hash object? Is it just an ordinary object?
  • Is this term something often used in JavaScript development, or a habit of Angular developers?
  • If hash object is just an object, what other kinds of objects exist?
  • Are object hash and hash object same thing? If so, they should probably revise their documentation.

Comment to answers:

As I asked several questions, each answerer seems to have answered best to a single part. For future reference, each of them is valuable and worth the read.

like image 559
Nikola Radosavljević Avatar asked Jan 26 '14 15:01

Nikola Radosavljević


People also ask

What is an object hash?

A hash object is dynamically created in memory at run-time. The size of a hash object grows as items are added and it contracts as items are removed. A hash object consists of key columns, data columns, and methods such as DECLARE, FIND, etc. A hash object's scope is limited to the DATA step in which it is created.

Is a JavaScript Object A hash table?

A JavaScript Object is an example of a Hash Table because data is represented a key/value pairs. A hashing function can be used to map the key to an index by taking an input of any size and returning a hash code identifier of a fixed size.


1 Answers

  1. Just ordinary object
  2. It's just object, so it's common thing.
  3. Functions-objects
  4. Yes. PR are welcome :) http://angularjs.org/i-want-to-help
like image 140
OZ_ Avatar answered Sep 25 '22 19:09

OZ_