js回調函數:js先執行完一個函數後再執行下面的邏輯或者方法

錯誤的列子:html //獲取年齡的方法 function getAge(name){ let age=10; return age; } //須要調用的方法 function html(){ let strHtml=`` let age=getAge("小明");//在此但願調用獲取年齡方法獲得小明的年齡 strHtml="小明的年齡爲:"+age;
相關文章
相關標籤/搜索