提交 3561ff13 编写于 作者: 杜庆泉's avatar 杜庆泉

关键字 instanceOf 示例调整

上级 11f940f3
...@@ -24,12 +24,16 @@ export function testKeyWord(): Result { ...@@ -24,12 +24,16 @@ export function testKeyWord(): Result {
test('instanceof', () => { test('instanceof', () => {
let user1 = new User() let user1:any = new User()
let instanceRet1 = user1 instanceof User let instanceRet1 = user1 instanceof User
expect(instanceRet1).toEqual(true) expect(instanceRet1).toEqual(true)
let instanceRet2 = user1 instanceof String let instanceRet2 = user1 instanceof String
expect(instanceRet2).toEqual(false) expect(instanceRet2).toEqual(false)
let num1:any = 3.1415926
let instanceRet3 = num1 instanceof String
expect(instanceRet3).toEqual(false)
let instanceRet4 = num1 instanceof Number
expect(instanceRet4).toEqual(true)
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册