Skip to content

Instantly share code, notes, and snippets.

@hayleyxyz
Created February 27, 2020 12:09
Show Gist options
  • Save hayleyxyz/11d6e058487e21cb35bbfaf1b2627ef1 to your computer and use it in GitHub Desktop.
Save hayleyxyz/11d6e058487e21cb35bbfaf1b2627ef1 to your computer and use it in GitHub Desktop.
const x = (strings, ...params) => {
let arr = '';
for(let i = 0; i < params.length; i++) {
arr += (strings[i]);
arr += (params[i]);
}
arr += (strings[params.length]);
return arr;
}
function t(a, b) {
}
j = 'hello'
i = 0
l = 1;
obj = {a:'test', b:{i}}
obj.obj = obj
arr = new Array(Math.pow(2, 16))
t(x`test ${j} butt ${i} ${l}`, `test ${j} butt ${i} ${l}`)
t(x`hello ${i} butts`, `hello ${i} butts`)
t(x`${i}${i}${i}${i}`, `${i}${i}${i}${i}`)
t(x`0${i}1${i}2${i}3${i}4`, `0${i}1${i}2${i}3${i}4`)
t(x` . `, ` . `)
t(x` ${obj.a} ${obj}`, ` ${obj.a} ${obj}`)
t(x` ${obj.obj} ${obj.obj.obj.obj.obj.b.i}`, ` ${obj.obj} ${obj.obj.obj.obj.obj.b.i}`)
t(x` ${arr[arr.length - 100]} ${arr}`, ` ${arr[arr.length - 100]} ${arr}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment