Write a java script that will replace following specified value with another value in a string.
string = “ i will fail”
replace “fail” by “pass”
<html>
<head>
<title>Display number in words</title>
</head>
<body>
<script>
var str = "I will fail";
document.write("Original String : " + str);
// strObj.replace(src, dest);
document.write("<br><br>After replace string is : " + str.replace("fail", "pass"));
var newStr = str
</script>
</body>
</html>
