Skip to content

More low-hanging transformations #794

@jvoisin

Description

@jvoisin

Maths

  • Number(s)+[s] +s
  • n=n-1n--
  • n=n+1n++
  • all the n = n ° mn°=m family, with ° being +, -, /, * and %
  • ParseFloat(n)+n
  • x!=yx^y if x and y are integers
  • -10~9, -100~99, … and so on :D
  • N00…0 with N an integer → Ne00…0
  • a>=ba>b-1 if -10 < b < 10
  • a<=ba<b-1 if -10 < b < 10
  • Math.abs(a)a>0?a:-a if a is one char.
  • Math.sqrt(a)a**.5

Arrays

  • a.concat()[...a]
  • x[x.length-N]x.at(N)

Random

  • Math.random()<0.5new Date&1, as Date returns a number of ms, albeit it might be problematic if called in a super-tight loop.
  • Math.floor(Math.random()*N))new Date%N

Misc

  • while(1)for(;;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions