I have an javscript object finalTitleList =[{&quot;Title&quot;:&quot;ffd&quot;,&quot;Iscompleted&quot;:&quot;&quot;,&quot;Id&quot;:0},                  {&quot;Title&quot;:&quot;fdfmdbk&quot;,&quot;Iscompleted&quot;:&quot;&quot;,&quot;Id&quot;:1},                  {&quot;Title&quot;:&quot;fdf,d&quot;,&quot;Iscompleted&quot;:&quot;&quot;,&quot;Id&quot;:2}]  Suppose i like to delete an 2nd item using delete finalTitleList[1], after deletion it delete the item but length is not updated(snapshot attached: contain only 2 item but showing length 3). So when i am adding that object in localstorage using localStorage.setItem(&quot;TaskTitleList16&quot;, JSON.stringify(finalTitleList));  On place of deleteditem it shows null. I want to completely remove that item, please help me.
5654
What is the difference between using  on the array element as opposed to using ?   For example:  myArray = ['a', 'b', 'c', 'd'];  delete myArray[1]; //  or myArray.splice (1, 1);   Why even have the splice method if I can delete array elements like I can with objects?
50943
Can I control the order static objects are being destructed? Is there any way to enforce my desired order? For example to specify in some way that I would like a certain object to be destroyed last, or at least after another static object?
4495
How do I check if an object has a specific property in JavaScript?  Consider:  x = {'key': 1}; if ( x.hasOwnProperty('key') ) {     //Do this }   Is that the best way to do it?
55117
I have a list, a list filter and two date filters(Start date and end date) in a page. First I have to filter list using this filters and then I have to approve whatever item are left in the list after filtering.  I am using the following JavaScript code.      &lt;script type="text/javascript"&gt;  //var siteUrl = '/projects/SharePoint2013-Demo/TimesheetManagementSystem/'; var oList = null; var web = null; var clientContext  = null;    function retrieveListItems() {  var filterValue =document.getElementById("ctl00_ctl41_g_1c91c2d4_fbbb_4792_8507_ba589e5be222_SpListPicker_SelectionBox"); var StartDate=document.getElementById("ctl00_ctl41_g_ed4beb82_8f7e_4389_bb35_a44188462aab_DateFilterPicker_DateFilterPickerDate");   var EndDate=document.getElementById("ctl00_ctl41_g_07c2185d_e903_4010_8a84_b2d9536a5549_DateFilterPicker_DateFilterPickerDate"); alert(filterValue.value ); alert(StartDate.value); alert(EndDate.value);       clientContext = new SP.ClientContext.get_current();     oList = clientContext.get_web().get_lists().getByTitle('TimeSheetList');     clientContext.load(oList);      clientContext.executeQueryAsync(LoadList, onQueryFailed);           }   function LoadWeb123(sender,args) {     //oList = web.get_lists().getByTitle('TimeSheetList');      //clientContext.load(this.oList);     //clientContext.executeQueryAsync(Function.createDelegate(this, this.LoadList), Function.createDelegate(this, this.onQueryFailed));     }    function LoadList() {            var  camlQuery= new SP.CamlQuery();                    camlQuery.set_viewXml("&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;And&gt;&lt;And&gt;&lt;Eq&gt;&lt;FieldRef Name='Author'/&gt;&lt;Value Type='User'&gt;vikash kumar&lt;/Value&gt;&lt;/Eq&gt;&lt;Geq&gt;&lt;FieldRef Name='Date' /&gt;&lt;Value Type='DateTime'&gt;2015-07-10T12:00:00Z&lt;/Value&gt;&lt;/Geq&gt;&lt;/And&gt;&lt;Leq&gt;&lt;FieldRef Name='Date' /&gt;&lt;Value Type='DateTime'&gt;2015-07-17T12:00:00Z&lt;/Value&gt;&lt;/Leq&gt;&lt;/And&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;");       camlQuery.set_viewXml(camlQuery);      this.collListItem = oList.getItems(camlQuery);       clientContext.load(collListItem);     clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));     }    function onQuerySucceeded(sender, args) {      var listItemInfo = '';       var listItemEnumerator = collListItem.getEnumerator();      while (listItemEnumerator.moveNext()) {                 var oListItem = listItemEnumerator.get_current();                 var ID= oListItem.get_id();                 alert(ID);                 } }   function onQueryFailed() { //    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());     alert('error'); }   &lt;/script&gt;  &lt;button type="button" onclick="retrieveListItems()"&gt;Approve!&lt;/button&gt;   But this is not working, it gives error alert.  What could be done? Is there anything wrong with the code?
27026
Something like  var life= {         users : {              guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); },              girls : function(){ this.SOMETHING.kiss(this.boys); },         },         mameAndDestroy : function(group){ },         kiss : function(group){ } };   this.SOMETHING is what I imagine the format is, but it might not be. What will step back up to the parent of an object?
73555
I am currently trying to write javascript within a script editor to hide the 'View Properties' and 'Edit Properties' items in the ECB.  I have found many solutions that edit the core.js file. However, that is not preferable for me as there are multiple sites adn this is not for every site and every library. Eventually this will be applied to a certain library but right now I would just like this to work in general before I worry about that.  I have tried removing the item when the menu is loaded using the below javascript. Where #mp6_0_3 is the id of the 'Edit Properties' menu item.  &lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt; &lt;/script&gt;   &lt;script language="javascript" type="text/javascript"&gt;  $(document).ready(function() {     $('.ms-core-menu-list').live('mouseover', function() {         $('#mp6_0_3').parent().hide();         $('#mp6_0_3').remove();            }); }); &lt;/script&gt;
93329
i am trying to update a listitem in a event receiver on FeatureActivated in a document library.   public override void FeatureActivated(SPFeatureReceiverProperties properties)     {          SPSecurity.RunWithElevatedPrivileges(delegate()         {             using (SPSite site = SPContext.Current.Site)             {                 using (SPWeb myweb = site.OpenWeb())                 {                   SPList list = myweb.Lists.TryGetList("Document Library");                 SPListItemCollection items = list.GetItems();                  for (int i = 0; i &lt; items.Count; i++)                 {                      SPListItem item = items[i];                        Guid fieldID = item.Fields.GetFieldByInternalName("Age").Id;                      string valueField = item[fieldID].ToString();                     valueField = "";                     item.Update();                 }                 }             }         });                 }   My field does not get empty?
110273
How can I add remove and create a callback/event for a custom property using bpy. I have a scene, called scene, and I want to add a custom property named x, defulat value 2 (as intereger), and a callback foo, to run when it is changed. I also need to be able to read the value from it, and delete it. How do I do this?
13441
What's the fastest way to count the number of keys/properties of an object?  It it possible to do this without iterating over the object?  i.e. without doing  var count = 0; for (k in myobj) if (myobj.hasOwnProperty(k)) count++;   (Firefox did provide a magic __count__ property, but this was removed somewhere around version 4.)
1719
Say I create an object as follows: let myObject = {   &quot;ircEvent&quot;: &quot;PRIVMSG&quot;,   &quot;method&quot;: &quot;newURI&quot;,   &quot;regex&quot;: &quot;^http://.*&quot; };  How should I remove the property regex to end up with new myObject as follows? let myObject = {   &quot;ircEvent&quot;: &quot;PRIVMSG&quot;,   &quot;method&quot;: &quot;newURI&quot; };
70774
I'm trying to find an automated way to mass delete picklist values. I had a look at the following ways to accomplish this but without success:   Force.com IDE: Deleting the picklist values in the metadata makes them Inactive when uploading Using a Javascript hack:  which was not working anymore due to the deprecated synchronous XMLHttpRequest. Converted to code using jQuery to async processing but didn't work. Seems like the page to replace the picklist values is stopping the deletion Destructive XML on Picklist value Changing type to Text and back to Picklist: Picklist values will be auto created based upon distinct data   Any other ideas?
17067
I have three rows on a Visualforce page. The requirement is that when any value of this field is blank it will show the error message on the page. I have to do this with the help of JSON and by using the following javascript function but I'm stuck. I am new on salesforce and JSON  &lt;script type="text/javascript"&gt;    var text = '{"val":['{"TValueFields"}' ] }';     obj = JSON.parse(text);              function findBlank() {             debugger;                        for (i=0; i&lt; obj.length; i++)               {                         var js = JSON.stringify(obj);              if(document.getElementById(js).value == " ")               {                          alert("TValueFields must be select");               }                     i++        } &lt;/script&gt;
108638
This is very annoying. I need to delete an action I keep hitting x and clear animation data and all that, won't leave! I have quit and reopened, there is no 0 next to the name.
21198
I'm trying to remove a specific, named, item if it is dropped on the floor. I have the following on my command block:  kill @e[type=Item] {Item:{tag:{display:{Name:"RedFlag"}}}   But it's removing all items, not just the one I want. What am I doing wrong?  I also tried  kill @e[type=Item] {Item:{id:"red_flower",Damage:2}}   But that didn't work either, it's still removing all items, even things that aren't red flowers!
67234
Below is the code tried,  @wire(getObjectDetails)     wiredResult(data,error) {          if(data){             console.log('DateOfRun--&gt;',data);             this.lstRecs=data;             console.log('values len--&gt;',this.lstRecs);             console.log('values --&gt;',this.lstRecs.values);         } else if(error){             console.log('error --&gt;'+error);            }     }    I am getting data as [object Object],But would like to fetch the values of a record.  i tried below:   @wire(getObjectDetails)     wiredResult(data,error) {          if(data){             console.log('DateOfRun--&gt;',data);//[object object]             this.lstRecs=data;             console.log('values len--&gt;',JSON.stringify(data));//Getting json value             this.strtest=JSON.stringify(data);             console.log('data=='+this.strtest.data);//undefined          } else if(error){             console.log('error --&gt;'+error);            }     }
104493
I have Library on which I have created a ribbon button. On click of the button I am trying to identify if the selected item is a folder or a file. below if the code snippet that I am using:  var context = SP.ClientContext.get_current(); var web = context.get_web();  var items = SP.ListOperation.Selection.getSelectedItems(context);  var currentLibrary = web.get_lists().getById(SP.ListOperation.Selection.getSelectedList(context));  var index; for (index in items) {     var selectedItem = currentLibrary.getItemById(items[index].id);     // Need to identify if 'selectedItem' is folder or not     console.log("FileSystemObjectType = " + selectedItem.FileSystemObjectType); // Returns 'undefined'     console.log("get_file = " + selectedItem.get_file()); // Returns 'SP.ListItem' object     console.log("get_folder = " + selectedItem.get_folder()); // Returns 'SP.ListItem' object }   Taking reference from  I tried to use FileSystemObjectType but in my case it ends up showing undefined for both file and folder. Also if I try to check if the selected item is a file or folder using below code it always return true.  if(item.FileSystemObjectType == SP.FileSystemObjectType.Folder) {     // Always returns true }   What am I doing wrong here? How can I identify if the selected item in Library is a file or a folder?
118709
I need to insert/update/delete a variable number of records at a time from a webapp (so from javascript), are there reasons to choose the  over writing a custom Apex REST class to do this or vice versa?