Apparently, getLocation() returns a promise, so the proper way to write the call is as below.
it('should keep the left nav links floating along with the page', function () {
var initTop = 0;
var initLeft = 0;
element(by.id('pd_page_nav')).getLocation().then(function (navDivLocation) {
initTop = navDivLocation.y;
initLeft = navDivLocation.x;
browser.get("en-us/learn#dpacreditresource");
element(by.id('pd_page_nav')).getLocation().then(function (navDivLocation2) {
var currTop = navDivLocation2.y;
var currLeft = navDivLocation2.x;
expect(currLeft).toBe(initLeft);
expect(currTop).toBeGreaterThan(initTop);
});
});
});