I'm sorry since I cannot edit my post I'll rewrite the example for better visual
Function A
calls AJAX get data
wait-for-previous-actions
browser log AJAX.LastData
set return value from AJAX.LastData
Function B (async)
Has localValue X as number, default number -1
set X with value Functions.A
wait-for-previous-actions
browser log x