提交 4d85b7bc 编写于 作者: 杜庆泉's avatar 杜庆泉

slice 新增 负数参数的示例

上级 ba05f732
...@@ -206,6 +206,10 @@ export function testString(): Result { ...@@ -206,6 +206,10 @@ export function testString(): Result {
expect(str6).toEqual("The morning is upon us."); expect(str6).toEqual("The morning is upon us.");
expect("".slice()).toEqual(""); expect("".slice()).toEqual("");
expect("abcdefg".slice(-1)).toEqual("g");
expect("abcdefg".slice(-1,-2)).toEqual("");
}) })
test('split', () => { test('split', () => {
const str = 'The quick brown fox jumps over the lazy dog.'; const str = 'The quick brown fox jumps over the lazy dog.';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册