You're viewing the legacy docs. They are deprecated as of May 18, 2016.
These docs are for version 2.4.2 and below of the Javascript SDK. Go to our current docs, or see our Web migration guide.

Version 2.4.2Changelog

DataSnapshot.getPriority()

The following example shows how to use getPriority() to get the priority of the node represented by a DataSnapshot:

var ref = new Firebase("https://docs-examples.firebaseio.com/samplechat/users");
ref.setWithPriority("fred", 500, function(error) {
  ref.once("value", function(snapshot) {
    var priority = snapshot.getPriority();
    // priority === 500
  });
});

If the node represented by a DataSnapshot has no priority, getPriority() returns null:

var ref = new Firebase("https://docs-examples.firebaseio.com/samplechat/users");
ref.set("fred", function(error) {
  ref.once("value", function(snapshot) {
    var priority = snapshot.getPriority();
    // priority === null
  });
});