理解这一行jQuery

Ran*_*lue 2 jquery

jQuery 1.7rc1的第3906行是

expando = "sizcache" + (Math.random() + '').replace('.', ''),

我不明白使用的意义+ ''.不是以上等同于

expando = ("sizcache" + Math.random()).replace('.', ''),

Ros*_*gan 6

+ '' 是将其转换为字符串 - 它允许替换工作.

如果大小的文本改为包含a,则不一样.

"sizcache." + (Math.random() + '').replace('.', '') != ("sizcache." + Math.random() + '').replace('.', '')
Run Code Online (Sandbox Code Playgroud)

例如.