This file contains 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 players = [ | |
'Tom Brady', | |
'Aaron Rodgers', | |
'Drew Brees', | |
'Ben Roethlisberger', | |
'Philip Rivers', | |
'Aqib Talib', | |
'Alex Smith', | |
'Larry Fitzgerald' | |
]; |
This file contains 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 now = new Date(); | |
for (var d = now; d >= new Date(new Date().getFullYear(), 0, 1); d.setDate(d.getDate() - 1)) { | |
if (d.getDay() == 3) { | |
console.log(new Date(d)); | |
} | |
} |
This file contains 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 arrowFunction = x => x % 2 == 0 ? "even" : "odd"; | |
for(var i = 0; i < 100; i++) { | |
console.log([i] + " " + arrowFunction([i])); | |
} |
This file contains 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.Linq; | |
using System.Text.RegularExpressions; | |
class MainClass { | |
public static string LongestWord(string sen) { | |
// remove unwanted characters (everything except a-z 0-9 or spaces) | |
sen = Regex.Replace(sen, @"[^a-zA-Z0-9 ]+", "", RegexOptions.Compiled); | |
// split words into array | |
string[] words = sen.Split(' '); |