Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. myArray.filter(element => element.includes("substring")); The above one will return an array of substrings. myArray.find(element => element.includes("substring")); The above one will return the first result element from the array. myArray.findIndex(element => element.includes("substring"));

  2. 4 cze 2024 · The substring() method of String values returns the part of this string from the start index up to and excluding the end index, or to the end of the string if no end index is supplied.

  3. 28 cze 2022 · You can use the includes() method in JavaScript to check if an item exists in an array. You can also use it to check if a substring exists within a string. It returns true if the item is found in the array/string and false if the item doesn't exist.

  4. 19 lip 2022 · To check if String contains substring from an array in JavaScript, you can use any of the following methods – Use the Array.some() and str.includes() methods. Use the Array.filter() and str.includes() methods.

  5. 12 lip 2024 · To find the index of an element within an array that contains a specific substring in JavaScript, there are multiple strategies available. The methods offer flexibility in handling various scenarios, allowing you to efficiently locate the index of the desired substring within the array.

  6. 7 kwi 2011 · Using underscore.js or lodash.js, you can do the following on an array of strings: var contacts = ['Billy Bob', 'John', 'Bill', 'Sarah']; var filters = ['Bill', 'Sarah']; contacts = _.filter(contacts, function(contact) { return _.every(filters, function(filter) { return (contact.indexOf(filter) === -1); }); }); // ['John']

  7. 23 lis 2016 · I need to find the substrings within my array. If I have an array: ["abc", "abcd", "abcde", "xyz"], my method should return the array members: abc, abcd, abcde as each is a substring or a superstri...

  1. Ludzie szukają również