如何在Visual Studio 2015中对Windows 10应用程序进行单元测试?
I created a Blank App Universal Windows project and added a new Unit Test Project to the solution, but when I try to add a reference to my UWP app in the Test Project, I get an error saying 'Unable to add a reference to project "Project Name"'.
如何使用JSON.stringify将负零转换为字符串(-0)?似乎JSON.stringify将负零转换为表示正数的字符串.想要一个好的解决方法吗?
var jsn = {
negative: -0
};
isNegative(jsn.negative) ? document.write("negative") : document.write("positive");
var jsonString = JSON.stringify(jsn),
anotherJSON = JSON.parse(jsonString);
isNegative(anotherJSON.negative) ? document.write("negative") : document.write("positive");
function isNegative(a)
{
if (0 !== a)
{
return !1;
}
var b = Object.freeze(
{
z: -0
});
try
{
Object.defineProperty(b, "z",
{
value: a
});
}
catch (c)
{
return !1;
}
return !0;
}
Run Code Online (Sandbox Code Playgroud)