Normal
When asking a question, try and simplify your code down to exactly what you're trying to do (and many times you'll figure out the solution in the process), instead of including a bunch of domain logic.Anyways, [ICODE]$.when[/ICODE] returns a promise, so you'd likely do something like:[CODE]function checkPhoneExists(phone) { return $.when(checkPhoneNumberAjax(phone));}[/CODE]Then you could reference it like:[CODE]const result = await checkPhoneExists('XXX-XXXX');[/CODE]
When asking a question, try and simplify your code down to exactly what you're trying to do (and many times you'll figure out the solution in the process), instead of including a bunch of domain logic.
Anyways, [ICODE]$.when[/ICODE] returns a promise, so you'd likely do something like:
[CODE]function checkPhoneExists(phone) {
return $.when(checkPhoneNumberAjax(phone));
}
[/CODE]
Then you could reference it like:
[CODE]const result = await checkPhoneExists('XXX-XXXX');