2

The following code is extracted from SharePoint's SP.UserProfiles.debug.js library.

    getUserProfilePropertiesFor: function (d) {
    a: ;
    var b = this.get_context(),
    a,
    c = new SP.ClientActionInvokeMethod(this, "GetUserProfilePropertiesFor", [d]);
    b.addQuery(c);
    a = [];
    b.addQueryIdAndResultObject(c.get_id(), a);
    return a
}

What does the "a: ;" on second line mean? When I step-through in IE Developer tool, that line was skipped right through. But it also does not look like a label as it has a semi-colon at the end.

8
  • Huh, I'd never seen this before, but apparently it can be used to label a statement... Here's some more about it on MDN. Commented Aug 2, 2017 at 2:18
  • 2
    Why would a semi-colon mean that it was not a label? It's a label on an empty statement. Commented Aug 2, 2017 at 2:23
  • @torazaburo He probably meant "variable" Commented Aug 2, 2017 at 2:29
  • At first I thought it was minified code and some kind of marker for the minification. But then I saw it came from a file ending in *.debug.js and was horrified to think that was unminified code! Dear gods tell me they don't actually code their variable names like that! Commented Aug 2, 2017 at 2:46
  • @Sukima, that's SharePoint out of box JavaScript library. Commented Aug 2, 2017 at 2:56

1 Answer 1

3

What does the "a: ;" on second line mean?

It is a label statement : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.