Tutorial Gateway

  • C Language
  • Java
  • R
  • SQL
  • MySQL
  • Python
  • BI Tools
    • Informatica
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • QlikView
  • Js

JavaScript ValueOf

by suresh

The JavaScript ValueOf function is a String function that is used to return the string. The syntax of the JavaScript ValueOf function is:

String_Object.ValueOf()

JavaScript ValueOf Function Example

The following set of examples will help you understand the ValueOf function in JavaScript Programming Language.

TIP: The ValueOf function does not accept any arguments.

<!DOCTYPE html>
<html>
<head>
    <title> ValueOf JavaScript </title>
</head>
<body>
    <h1> JavaScript ValueOf </h1>
<script>
    var Str1 = "Tutorial Gateway";
    var Str2 = "Learn JavaScript";
    var Str3 = Str1.valueOf();
    var Str4 = Str2.valueOf();
    
    document.write(Str3 + "<br \>");
    document.write(Str4 + "<br \>");
    
    if (Str3 === Str4)
    {
        document.write(" Both are Equal <br \>");
    }
    else
    {
        document.write(" Both are Not Equal <br \>");
    }
</script>
</body>
</html>

OUTPUT

JavaScript VALUEOF Function

ANALYSIS

The following statement will return the value of above-declared string variables

  var Str3 = Str1.valueOf();
  var Str4 = Str2.valueOf();

Next, We used the JavaScript Else Statement to check whether the value of String variable Str1 is strictly equal to Str2 or not.

Placed Under: JavaScript

Trending Posts

Power BI Funnel Chart

MySQL SIGN Function

Find the Dependencies of a Table in SQL Server

Python Program to Concatenate Strings

Import Data From Excel to QlikView

C Program to Check the Given String is Palindrome

Python lower

MySQL Truncate Table

Joins in Power BI

Tableau String Functions

  • C Programs
  • Java Programs
  • SQL FAQ’s
  • Python Programs
  • SSIS
  • Tableau
  • JavaScript

Copyright © 2019 | Tutorial Gateway· All Rights Reserved by Suresh

Home | About Us | Contact Us | Privacy Policy