Javascript Enum Write List

enum Item
{
ID,
Name
};
var pItem : Item;

function Start () 
{/*
	Item apple = new Item();
	apple.ID = 1;
	apple.Name = "Apple";*/
	
	
	var apple;
	pItem.ID = 1;
	pItem.Name = "Apple";
	
}

Editor tells me that the fields are read only, why is that?

You seem to be confusing enums with classes. Enums are just a way of avoiding magic numbers by using words that represent numbers. You never use “new” with them or try to assign values like that. If you want to do that then you’d make a class.

P.S. Also never do things like “var apple;”…you must always define the type, either explicitly, or implicitly by declaring a value.