شرح صفوف ومحتوى الفقرة
يمكنك استخدام مفاتيح keys بداخل خصائص الكائنات object properites بطرق مختلفه :
- String with space : plane['date created'] يمكننا انشاء key مكون من اكتر من كلمة بينهم مسافة
- String without space : plane['name'] يمكننا انشاء key بداخل ال object بدون مسافات
- يمكنك استخدام ارقام كأسم أو قيمة للخصائص
- plane[''] : Empty String يمكننا انشاء string فارغ بداخل ال key
String with space : plane['date created'] يمكننا انشاء key مكون من اكتر من كلمة بينهم مسافة
HTML
let plane = new Object();
plane['date created'] = '12-12-1980';
/* Use key with string and spaces*/
document.write(plane['date created'] + "<br>");
plane[''] : Empty String يمكننا انشاء string فارغ بداخل ال key
HTML
var plane = new Object();
plane[''] = 'Even an empty string';
document.write(plane['']);
يمكنك استخدام ارقام كأسم أو قيمة للخصائص
String without space : plane['name'] يمكننا انشاء key بداخل ال object بدون مسافات
HTML
let plane =new Object();
plane['datecreated'] = '12-12-1980';
/* Use key with string and spaces*/
document.write(plane['datecreated'] + "<br>");