控制台中为什么会发生以下情况?还是我滥用了 indexOf?
document.forms:
[
<form id="form-0" name="form-0">…</form>
,
<form id="form-1" name="form-1">…</form>
,
<form id="form-2" name="form-2">…</form>
]
document.forms.indexOf["form-0"]:
TypeError: Cannot read property 'form-0' of undefined