JavaScript: Optional function parameters
Instructions
Loading...
Your exercise will be checked with these tests:
// @ts-check
import { expect, test } from 'vitest';
import f from './index.js';
test('test', () => {
expect(f('1234123412341234')).toEqual('****1234');
expect(f('1234123412344321')).toEqual('****4321');
expect(f('1234123412344321', 2)).toEqual('**4321');
expect(f('1234123412341234', 12)).toEqual('************1234');
});
Teacher's solution will be available in:
20:00
