Exercise 11: Function documentation

getFriendDistance(username)

Returns the “degrees of separation” between the specified user and the current user.

Any user is some “degrees of separation” from another user. For example, if they are friends, the distance is one, and if they are friends of friends, the distance is two. This function returns the distance from the specified user to the current user. If there is no connection between the users, then it returns NaN.

Parameters:

Returns:

safeMode(enable)

Enables or disables safe mode

Parameters:

Returns:

getPremiumMode()

Returns whether the user has paid for premium mode

Parameters:

Returns:

setTimeout(timeout)

Sets the time to wait for a response before timing out.

Parameters:

Returns:

newEvent(calendarId)

Creates a new event for the specified calendar with the ID passed in as the parameter.

Parameters:

Returns:

getDirections(latitude, longitude, directionsCallback)

Returns the directions from the current location to the destination location.

Parameters:

createTransaction(amount)

Creates a new transaction.

Parameters:

Returns:

See also:

getTransaction
deleteTransaction