Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is arbitrary data/JSON?

I've recently come across the term arbitrary data/ arbitrary json and i can't seem to understand what exactly is it and/or find any documentation on it. I know that JSON is a format for sending data over the internet, so how exactly can a format be arbitrary?

EDIT::

//more code

  var buildItem = function(item) {
    var title = item.name,
        args = [],
        output = '<li>';

    if (item.type == 'method' || !item.type) {
      if (item.signatures[0].params) {
        $.each(item.signatures[0].params, function(index, val) {
          args.push(val.name);
        });
      }
      title = (/^jQuery|deferred/).test(title) ? title : '.' + title;
      title += '(' + args.join(', ') + ')';
    } else if (item.type == 'selector') {
      title += ' selector';
    }
    output += '<h3><a href="' + item.url + '">' + title + '</a></h3>';
    output += '<div>' + item.desc + '</div>';
    output += '</li>';

    return output;
  };

//more code

in the example code above, i am told that the .params is arbitrary data from a JSON request [for the jQuery API documentation].

What then is arbitrary data?

Would really appreciate any answers and/or clarifications.

jsFiddle: http://jsfiddle.net/QPR4Z/2/

Thanks!

like image 602
Kenneth .J Avatar asked May 01 '14 08:05

Kenneth .J


1 Answers

arbitrary |ˈärbiˌtrerē|
adjective

based on random choice or personal whim, rather than any reason or system: his mealtimes were entirely arbitrary.

  • Mathematics: (of a constant or other quantity) of unspecified value.

It just means there could be any value in there. This is opposed to a specification that says something like "this array always contains X, Y and Z". Arbitrary values in contrast say "we're sending you something in this array, but we can't really tell you in advance what exactly that is." If you're told that you can send arbitrary data yourself, it means you can send anything you want, it doesn't have to follow any particular format.

Note that this is all about the data contained in the JSON format, not about the JSON format itself.

like image 174
deceze Avatar answered Oct 21 '22 01:10

deceze