Ad
Code
Diff
  • Palindrome=ॱ=>(ॱ=>ॱ==[...ॱ].reverse().join``)(ॱ.toUpperCase())
    • function Palindrome(str){
    • // Case insensitive palindrome
    • for (let i = 0, j = str.length - 1; i < j; i++, j--) {
    • if (str[i].toLowerCase() !== str[j].toLowerCase()) return false;
    • }
    • return true;
    • }
    • Palindrome=ॱ=>(ॱ=>ॱ==[...ॱ].reverse().join``)(ॱ.toUpperCase())
Code
Diff
  • isEven=ॱ=>_(ॱ)
    • isEven=x=>_(x)
    • isEven==>_(ॱ)
Code
Diff
  • Solution=ॱ=>`Hello World`
    • Solution=()=>"Hello World";
    • Solution=ॱ=>`Hello World`
Mathematics
Algorithms
Logic
Numbers
Data Types
Code
Diff
  • average=(ॱ,l=ॱ.length)=>l?ॱ.reduce((a,i)=>a+i/l,0):ॱ[0]
    • const average = a => a.length ? a.reduce((avg, i) => avg + i/a.length, 0): a[0];
    • average=(ॱ,l=ॱ.length)=>l?ॱ.reduce((a,i)=>a+i/l,0):ॱ[0]
Code
Diff
  • highAndLow=a=>(x=>`${Math.max(...x)} ${Math.min(...x)}`)(a.split` `)
    • highAndLow=a=>Math.max(...a=a.split` `)+` `+Math.min(...a)
    • highAndLow=a=>(x=>`${Math.max(...x)} ${Math.min(...x)}`)(a.split` `)
Code
Diff
  • returnHundred=_=>1e2
    • const returnHundred = () => 228 & 127;
    • // based on the rule that a & (2**b - 1) = a % 2**b
    • returnHundred=_=>1e2
Code
Diff
  • countVowelAtWord=s=>s.replace(!/[aeiou]/ig,``).length
    • function countVowelAtWord(str) {}
    • countVowelAtWord=s=>s.replace(!/[aeiou]/ig,``).length
Code
Diff
  • m=(a,b)=>a*b
    • function m (a, b) {
    • a * b
    • }
    • m=(a,b)=>a*b
Code
Diff
  • Palindrome=ॱ=>[...ॱ].reverse().join``==ॱ
    • let Palindrome =str=> str.split('').reverse().join('')===str
    • Palindrome=ॱ=>[...ॱ].reverse().join``==ॱ
Code
Diff
  • toiletRolls=r=>r>2
    • const toiletRolls=r=>r>2;
    • toiletRolls=r=>r>2
Code
Diff
  • returnhundred=ॱ=>100
    • returnhundred=_=>100
    • returnhundred==>100
Code
Diff
  • returnAscending=(...a)=>a.sort().join``
    • const returnAscending = (...args) => args.sort((a,b)=> a-b ).join('');
    • returnAscending=(...a)=>a.sort().join``
Code
Diff
  • findMax=ॱ=>Math.max(...ॱ)
    • const findMax=_=>Math.max(..._)
    • findMax==>Math.max(...)
Logic
Arrays
Data Types
Objects
Code
Diff
  • mapOrder=(a,o,k)=>!Array.isArray(a)?[]:(l=>o.map(k=>l.get(k)))(a.reduceRight((t,o)=>t.set(o[k],o),new Map))
    • function mapOrder(array, order, key) {
    • if (!Array.isArray(array)) return [];
    • const lookupTablea = array.reduceRight((table, o) => table.set(o[key], o), new Map());
    • return order.map(k => lookupTablea.get(k));
    • }
    • mapOrder=(a,o,k)=>!Array.isArray(a)?[]:(l=>o.map(k=>l.get(k)))(a.reduceRight((t,o)=>t.set(o[k],o),new Map))

Code
Diff
  • calculator=(a,b,ॱ)=>eval(a+ॱ+b)
    • calculator=(a,b,_)=>eval(a+_+b)
    • calculator=(a,b,)=>eval(a++b)
Loading more items...