What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-19 17:15:22
advanced data manipulation javascript
var array = [“blue”, “green”, “green”, “black”, “orange”, “blue”, “green”, “red”];var uniqueArray = [];uniqueArray = array.filter((element, index, array)=>{... Add solution -
C# 2022-03-03 11:15:21
sum array c#
int[] arr = new int[] { 1, 2, 3 }; int sum = 0; for (int i = 0; i < arr.Length; i++) { sum += arr[i]; } int[] arr = { 3, 6, 4, 1, 6, 8 }; // returns 1 Array.IndexOf(arr, 6); int maxValue = anArray.Max(); int maxIndex = anArray.ToList().IndexOf(m... Add solution -
Javascript 2022-02-27 05:40:22
8.3.1. Common Array Methods // indexOf Examples (.indexOf)
//The general syntax for this method is: arrayName.indexOf(item) /*This method returns the index of the FIRST occurence of an item in the array. If the item is not in the array, -1 is returned.*/ let charles = [1, 7, 5, 9, 5]; let otherArray = ['hello',... Add solution -
C# 2022-02-06 00:50:41
encrypption in C# console using mod of 26
namespace CaesarCipher { class Program { static void Main(string[] args) { // Determining if user wants to encrypt or decrypt. Console.WriteLine("Chose One: Encrypt / Decrypt"); string encryptDecrypt = Console.ReadL... Add solution -
Javascript 2022-01-28 05:55:22
callback without duplicates javascript
function myFunction(myArray, callBack){ var unique = myArray.filter(function(item, pos) { //validates whether the first occurrence of current item in array // equals the current position of the item (only return those items) return myArray.ind... Add solution