結果 : difference between path function and state function with examples