Your First Interface چالش 1 از جلسهی 12، آسان
این برنامه یک آهنگ را نشان میدهد، ولی Song هنوز ساخته نشده و خط قرمز میدهد.
بالای برنامه با interface شکل Song را بساز: title از نوع string و seconds از نوع number.
برنامه باید Sunrise 180 را نشان بدهد.
<style>
body { font-family: sans-serif; text-align: center; padding: 16px; }
button, input, select { font-size: 16px; min-height: 40px; margin: 4px; }
#out { direction: ltr; text-align: left; font: 16px monospace; margin: 12px 0; padding: 12px; min-height: 28px; border-radius: 12px; background: #0f172a; color: #e2e8f0; white-space: pre-wrap; overflow-wrap: anywhere; }
#out .line { min-height: 22px; }
</style>
<pre id="out"></pre>
<script type="text/typescript">
// make the interface Song here
const s: Song = { title: "Sunrise", seconds: 180 };
show(s.title, s.seconds);
</script>
راهنما و جواب این چالش · برگشت به درس جلسهی 12: اینترفیس · چالش بعدی: Ali Has No Nickname
بیشتر بخوان: جاوااسکریپت چیست؟ از دکمهی وب تا Node.js