This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [][(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+!+[]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var nombers = new[] { -1, 2, -154, 9, -47, 13 }; | |
| //linq way | |
| var min = nombers.SelectMany((n1, index1) => nombers.Where((_, index2) => index2 > index1).Select(n2 => Math.Abs(n2 - n1))).Min(); | |
| //traditional way | |
| var min = int.MaxValue; | |
| for (int i = 0; i < nombers.Length; i++) | |
| { | |
| for (int j = i + 1; j < nombers.Length; j++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const table = ['val1', 'val2', 'val3']; | |
| for (let i in table) { | |
| console.log(`index : ${i} ; element : ${table[i]}`); // => index : 0 ; element : val1 index : 1 ; element : val2 index : 2 ; element : val3 | |
| } | |
| for (let element of table) { | |
| console.log(`element : ${element}`); // => element : val1 element : val2 element : val3 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function FizzBuzz() { | |
| for (let i = 1; i <= 100; i++) { | |
| if ((i % 3 === 0) && (i % 5 === 0)) { | |
| console.log("FizzBuzz"); | |
| } else if (i % 3 === 0) { | |
| console.log("Fizz"); | |
| } else if (i % 5 === 0) { | |
| console.log("Buzz"); | |
| } else { | |
| console.log(i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function alternatingSums(array) { | |
| let evenSum = 0; | |
| let oddSum = 0; | |
| array.forEach(function(item, index) { | |
| if (index % 2 == 0) evenSum += item; | |
| else oddSum += item; | |
| }); | |
| return [evenSum, oddSum]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function allLongestStrings(array) { | |
| let lengthMax = 0; | |
| array.forEach(word => lengthMax = word.length > lengthMax ? word.length : lengthMax); | |
| return array.filter(word => word.length == lengthMax); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function add(...args) { | |
| let result = 0; | |
| args.forEach(element => result += element); | |
| return result; | |
| } | |
| //or | |
| function add2(...args) { | |
| return args.reduce((accumulator, current) => accumulator + current); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| namespace NarcissisticNumberDojo | |
| { | |
| public class NarcissisticNumber | |
| { | |
| public static IEnumerable<UInt64> NarcissisticNumberList(UInt64 maxNumber) | |
| { | |
| List<UInt64> narcissisticNumbers = new List<UInt64>(); |