TikTok Frontend Phone Screen

  1. Some basic front-end knowledge interviews are just super simple basic knowledge.

  2. Provide a few lines of code and determine the output of each code.
    For example:

const a = { b: 12}
const arr1 = [2, 3, a];
const arr2 = arr1.slice(1);

arr2[1].b++
arr2[0]++
a.b++
  1. Desired outcome:
const baseFn = createBase(6);
baseFn(5) ===> 11;
baseFn(7) ===> 13;

Write the createBase function.

Additional question:

baseFn(5)(6)(7) ==> 24
baseFn(5)(6)==> 17