加载中
JavaScript中的endsWith - endsWith in JavaScript

问题: How can I check if a string ends with a particular character in JavaScript? 如何在JavaScript中检查字符串是否以特定字符结尾? Example: I have a string 示例:我有一个字符串...

2020/04/11 00:02
25
您如何获得JavaScript时间戳? - How do you get a timestamp in JavaScript?

问题: How can I get a timestamp in JavaScript? 如何获取JavaScript时间戳? Something similar to Unix timestamp , that is, a single number that represents the current time and da...

2020/05/29 12:29
48
在JavaScript中逐个遍历数组? - For-each over an array in JavaScript?

问题: How can I loop through all the entries in an array using JavaScript? 如何使用JavaScript遍历数组中的所有条目? I thought it was something like this: 我以为是这样的: forE...

2020/03/24 00:12
21
sleep()的JavaScript版本是什么? - What is the JavaScript version of sleep()?

问题: Is there a better way to engineer a sleep in JavaScript than the following pausecomp function ( taken from here )? 是否有比下面的pausecomp函数( 从此处获取 )更好的方法来...

2020/03/28 11:47
17
JavaScript闭包如何工作? - How do JavaScript closures work?

问题: How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not unders...

2020/03/23 04:11
21
如何格式化JavaScript日期 - How to format a JavaScript date

问题: 如何格式化JavaScript日期对象以将其打印为10-Aug-2010 ? 解决方案: 参考一:https://stackoom.com/question/Eu9l/如何格式化JavaScript日期 参考二:https://oldbug.net/q/Eu9l/H...

2020/08/04 02:56
56
JavaScript中的HTTP GET请求? - HTTP GET request in JavaScript?

问题: I need to do an HTTP GET request in JavaScript. 我需要在JavaScript中执行HTTP GET请求。 What's the best way to do that? 最好的方法是什么? I need to do this in a Mac OS X ...

用JavaScript比较两个日期 - Compare two dates with JavaScript

问题: Can someone suggest a way to compare the values of two dates greater than, less than, and not in the past using JavaScript? 有人可以建议一种使用JavaScript比较两个大于,小...

2020/03/30 23:19
34
JavaScript闭包如何工作? - How do JavaScript closures work?

问题: How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not unders...

2020/07/28 15:18
14
在JavaScript中修剪字符串? - Trim string in JavaScript?

问题: 如何修剪JavaScript中的字符串? 解决方案: 参考一:https://stackoom.com/question/25nu/在JavaScript中修剪字符串 参考二:https://oldbug.net/q/25nu/Trim-string-in-JavaScript...

2020/06/11 04:45
13
JavaScript中==和===之间的区别[重复] - Difference between == and === in JavaScript [duplicate]

问题: This question already has an answer here: 这个问题已经在这里有了答案: Which equals operator (== vs ===) should be used in JavaScript comparisons? JavaScript比较中应使用哪...

2020/04/01 20:21
15
如何取消设置JavaScript变量? - How to unset a JavaScript variable?

问题: I have a global variable in JavaScript (actually a window property, but I don't think it matters) which was already populated by a previous script but I don't want anothe...

2020/05/15 21:14
6
使用JavaScript获取当前年份 - Get the current year in JavaScript

问题: 如何获得JavaScript的当前年份? 解决方案: 参考一:https://stackoom.com/question/PBSY/使用JavaScript获取当前年份 参考二:https://oldbug.net/q/PBSY/Get-the-current-year-in...

2020/04/17 19:10
10
如何遍历或枚举JavaScript对象? - How do I loop through or enumerate a JavaScript object?

问题: I have a JavaScript object like the following: 我有一个如下的JavaScript对象: var p = { "p1": "value1", "p2": "value2", "p3": "value3" }; Now I want to loop through all p...

2020/05/31 07:01
15
获取Javascript数组中的最后一项 - Get the last item in an array in Javascript

问题: Here is my JavaScript code so far: 到目前为止,这是我的JavaScript代码: var linkElement = document.getElementById("BackButton"); var loc_array = document.location.href.sp...

2020/04/12 22:34
67
如何在JavaScript中声明名称空间? - How do I declare a namespace in JavaScript?

问题: How do I create a namespace in JavaScript so that my objects and functions aren't overwritten by other same-named objects and functions? 如何在JavaScript中创建名称空间,以...

2020/06/19 07:56
55
JavaScript窗口调整大小事件 - JavaScript window resize event

问题: How can I hook into a browser window resize event? 如何挂钩浏览器窗口调整大小事件? There's a jQuery way of listening for resize events but I would prefer not to bring it...

2020/05/13 00:40
12
如何测试一个空的JavaScript对象? - How do I test for an empty JavaScript object?

问题: After an AJAX request, sometimes my application may return an empty object, like: 在AJAX请求之后,有时我的应用程序可能返回一个空对象,例如: var a = {}; How can I check ...

2020/05/31 08:01
56
JavaScript中的“ new”关键字是什么? - What is the 'new' keyword in JavaScript?

问题: The new keyword in JavaScript can be quite confusing when it is first encountered, as people tend to think that JavaScript is not an object-oriented programming language....

2020/06/05 21:39
12
TDD的JavaScript单元测试工具 - JavaScript unit test tools for TDD

问题: I've looked into and considered many JavaScript unit tests and testing tools, but have been unable to find a suitable option to remain fully TDD compliant. 我研究并考虑了...

2020/04/29 08:54
30

没有更多内容

加载失败,请刷新页面

返回顶部
顶部