SOURCE

function toggle() {

}

// 期望以下测试用例能够返回正确的结果
const hello = toggle('hello');
const onOff = toggle('on', 'off');
const color = toggle('red', 'green', 'blue');

console.log(hello());      // "hello"
console.log(hello());      // "hello"

console.log(onOff());    // "on"
console.log(onOff());    // "off"
console.log(onOff());    // "on"

console.log(color());     // "red"
console.log(color());     // "green"
console.log(color());     // "blue"
console.log(color());     // "red"
console 命令行工具 X clear

                    
>
console