I want to make a linked list using custom Object
that pushes a value, pop a value, display all its content, remove an item from a specific place, and insert at a specific place as long as the value is missing from the sequence otherwise through an exception.
All of the properties should be defined using data
descriptor, prevent them from being deleted, iterated, or being modified.
I can do no more than this ... I'm new to js.
var linkedList = {};
/* linkedList.name = 'Ahmed';
[].push.call(linkedList, 'sad', "sd");
*/
Object.defineProperty(linkedList, "name", {
value: "mohamed",
writable: false,
configurable: false,
enumerable: false
})
linkedList.next = {'sd':'as'};
Any help? thanks in advance
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…