Assignment GDB Solution: Javascript Basic


JavaScript isNaN() Function

JavaScript isNaN() Function The isNaN() function determines whether a value is an illegal number (Not-a-Number). This function returns true if the value is NaN, and false if not. Syntax isNaN(value) Example <script type=”text/javascript”> document.write(isNaN(123)+ “<br />”); document.write(isNaN(-1.23)+ “<br />”); document.write(isNaN(5-2)+ “<br />”); document.write(isNaN(0)+ “<br />”); document.write(isNaN(“Hello”)+ “<br />”); document.write(isNaN(“2005/12/12”)+ “<br />”); </script> Output false false false false […]

JavaScript encodeURIComponent() Function

JavaScript encodeURIComponent() Function The encodeURIComponent() function encodes a URI component. This function encodes special characters. In addition, it encodes the following characters: , / ? : @ & = + $ #. Tip: Use the decodeURIComponent() function to decode an encoded URI component. Syntax encodeURIComponent(uri) Example: Output: