public static bool DeleteObjectElem(Scriptable target, object elem, Context cx) { string s = ToStringIdOrIndex(cx, elem); if (s == null) { int index = LastIndexResult(cx); target.Delete(index); return !target.Has(index, target); } else { target.Delete(s); return !target.Has(s, target); } }