-
Notifications
You must be signed in to change notification settings - Fork 0
/
t1.js
69 lines (64 loc) · 1.65 KB
/
t1.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
let a=[
{
"type": "text",
"desc": "Desc1",
"status": "active",
"listenLimitCount": 0,
"fileId": null,
"id": "3ff008c9-88ff-4df0-be69-56d8803cf160",
"question": "Question1",
"answers": [
{
"id": "3ff008c9-88ff-4df0-be69-56d8803cf160",
"answer": "Answer1Q1"
},
{
"id": "3ff008c9-88ff-4df0-be69-56d8803cf161",
"answer": "Answer2Q1"
}
]
},
{
"type": "text",
"desc": "Desc2",
"status": "active",
"listenLimitCount": 0,
"fileId": null,
"id": "3ff008c9-88ff-4df0-be69-56d8803cf161",
"question": "Question2",
"answers": [
{
"id": "3ff008c9-88ff-4df0-be69-56d8803cf162",
"answer": "Answer1Q2"
},
{
"id": "3ff008c9-88ff-4df0-be69-56d8803cf163",
"answer": "Answer2Q2"
}
]
}
]
let b={
"type": "text",
"desc": "Desc1",
"status": "active",
"listenLimitCount": 0,
"fileId": null,
"id": "3ff008c9-88ff-4df0-be69-56d8803cf160",
"question": "Question1",
"answers": [
{
"id": "3ff008c9-88ff-4df0-be69-56d8803cf160",
"answer": "Answer1Q1"
},
{
"id": "3ff008c9-88ff-4df0-be69-56d8803cf161",
"answer": "Answer2Q1"
}
]
}
let pointer="3ff008c9-88ff-4df0-be69-56d8803cf160"
pointer="3ff008c9-88ff-4df0-be69-56d8803cf161"
let c=a.filter(question => question.id === pointer)[0]
let d=a.indexOf(c)
console.log(d)