预测以下代码片段的输出结果:() var student = new Object( ); student.study = function( ) {window.alert(“开始学习了”); } study( );
A:输出“开始学习了”
B:程序出错。不能在实例化对象之后,再添加方法
C:程序出错。study()方法不能直接调用。应该用student来调用
D:程序出错。给student.study赋值时,右边的函数必须有名字
出自:计算机科学