Q:

Why using this method to return a function or value?

I'm just wondering why should I use this method to return a function :
clusters.prototype.get_local_storage_data = function(data_key) {
    return +(this.localStorage.getItem(data_key) || 1);
};

What does the +() do there and why using that ? Is there a better way of returning the function or 1 if what the function gets is null ?

A:

Using the + before a value forces that value to become a number. In the case above, the data key will be converted to a number (if it's found), or the number 1 will be returned. Either way, the result will be converted to a number.
+null;   // 0
+"3.14"; // 3.14
+1;      // 1

It's just ensuring that no matter what the output is, you will be returning a number.

