Javascript Check If Variable Is Function Of Beauty