GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing fa.javascript.info — کوتِیشِن‌های رشته

  • آموزش
  • زبان جاوااسکریپت
  • مفاهیم پایه‌ای جاوااسکریپت
  • انواع داده
بازگشت به درس

کوتِیشِن‌های رشته

اهمیت: 5

خروجی این اسکریپت چه خواهد بود :

let name = "Ilya";

alert( `hello ${1}` ); // ?

alert( `hello ${"name"}` ); // ?

alert( `hello ${name}` ); // ?

Backticks عبارت داخل {...}$ را در رشته قرار می‌دهد.

let name = "Ilya";

// عبارت، عدد 1 است
alert( `hello ${1}` ); // hello 1

// است "name" عبارت، رشته
alert( `hello ${"name"}` ); // hello name

// عبارت، یک متغیر است، مقدار آن را داخل رشته قرار می‌دهد
alert( `hello ${name}` ); // hello Ilya
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.