Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [‘“bc’, ‘defg’] → ‘?????’ → [‘abc’,’defg’]
- json.stringify([‘“bc’, ‘defg’]) -> “[‘\”bc’,’defg’]”
- [999, 123] -> “[999,123]”
- N elements , <= L L+5
- 0-9 ->1
- 10-99 -> 2
- 100-999 -> 3
- string length is (2+ ((2*N) -1) + (N * log(10, L)))
- function wrap(action, msec) : wrapped_action
- function wrap(action, msec) {
- let lastTime = 0;
- const fn = () => {
- const now = new Date().getTime();
- if( now >= lastTime + msec ){
- action();
- lastTime = now;
- } else {
- setTimeout( fn, now - (lastTime + msec) )
- }
- }
- return fn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement