热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址
首页 / 面试主题 / JavaScript
WithoutBook LIVE 模拟面试 JavaScript 相关面试主题: 19

面试题与答案

了解热门 JavaScript 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。

共 59 道题 面试题与答案

面试前建议观看的最佳 LIVE 模拟面试

了解热门 JavaScript 面试题与答案,帮助应届生和有经验的候选人为求职面试做好准备。

面试题与答案

搜索问题以查看答案。

资深 / 专家级别面试题与答案

问题 1

What's relationship between JavaScript and ECMAScript?

ECMAScript is yet another name for JavaScript (other names include LiveScript). The current JavaScript that you see supported in browsers is ECMAScript revision 3.
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 2

Write a javascript to get difference between two dates.

now = new Date();
newYear = new Date(2004,0,1);

secs = Math.round((now-newYear)/1000);

days = Math.floor(secs / 86400);
secs = days*86400;
hours = Math.floor(secs / 3600);
secs = hours*3600;
minutes = Math.floor(secs / 60);
secs = minutes*60

document.write(days + " days, " +
hours + " hours, " +
minutes + " minutes, and " +
secs + " seconds.");
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 3

What is User-Defined class in Javascript?

can define new classes, but the notation is awkward
simply define a function that serves as a constructor
specify data fields & methods using this

no data hiding: can't protect data or methods

function Die(sides)
{
this.numSides = sides;
this.numRolls = 0;
this.Roll = Roll;
}

function Roll()
{
this.numRolls++;
return Math.floor(Math.random()*this.numSides) + 1;
}

die6 = new Die(6);
die8 = new Die(8);

roll6 = -1; // dummy value to start loop
roll8 = -2; // dummy value to start loop
while (roll6 != roll8) {
roll6 = die6.Roll();
roll8 = die8.Roll();

document.write("6-sided: " + roll6 +
"    " +
"8-sided: " + roll8 + "
");
}
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 4

Where are cookies actually stored on the hard disk?

This depends on the user's browser and OS.
In the case of Netscape with Windows OS,all the cookies are stored in a single file called

cookies.txt
c:\Program Files\Netscape\Users\username\cookies.txt
In the case of IE,each cookie is stored in a separate file namely username@website.txt.
c:\Windows\Cookies\username@Website.txt
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 5

Are you concerned that older browsers don't support JavaScript and thus exclude a set of Web users or individual users?

Fragmentation of the installed base of browsers will only get worse. By definition, it can never improve unless absolutely everyone on the planet threw away their old browsers and upgraded to the latest gee-whiz versions. But even then, there are plenty of discrepancies between the scriptability of the latest Netscape Navigator and Microsoft Internet Explorer.
The situation makes scripting a challenge, especially for newcomers who may not be aware of the limitations of earlier browsers. A lot of effort in my books and ancillary material goes toward helping scripters know what features work in which browsers and how to either workaround limitations in earlier browsers or raise the compatibility common denominator.
Designing scripts for a Web site requires making some hard decisions about if, when, and how to implement the advantages scripting offers a page to your audience. For public Web sites, I recommend using scripting in an additive way: let sufficient content stand on its own, but let scriptable browser users receive an enhanced experience, preferably with the same HTML document.
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 6

What does the "Access is Denied" IE error mean?

The "Access Denied" error in any browser is due to the following reason.
A javascript in one window or frame is tries to access another window or frame whose document's domain is different from the document containing the script.
保存以便复习

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
这有帮助吗?
添加评论 查看评论
问题 7

How to hide javascript code from old browsers that dont run it?

Use the below specified style of comments
版权所有 © 2026,WithoutBook。