allows javascript to restrict object key value pairs by an array