我是新來的。我在腳本中有以下代碼:function Person(first_name, last_name) { this.first_name = first_name; this.last_name = last_name; this.displayName = function() { console.log(`Name: ${this.first_name} ${this.last_name}`); };}let john = new Person('John', 'Reid');john.displayName();此代碼的輸出為:“姓名:約翰·里德”我想了解這是如何工作的?$ 在此代碼中扮演什么角色?在JavaScript語言規范的這一部分或其他一些庫在這里工作嗎?謝謝
控制臺.log語句如何與帶引號的字符串值中的 $ 符號一起使用?
慕尼黑5688855
2022-09-23 21:32:46