हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा ११

Write note on string Operator.

Advertisements
Advertisements

प्रश्न

Write note on string Operator.

संक्षेप में उत्तर
Advertisements

उत्तर

One of the built-in features of JavaScript is the ability to concatenate strings. The + operator performs addition on numbers but also serves as the concatenation operator for strings. Because string concatenation has precedence over numeric addition, + will be interpreted as string concatenation if any of the operands are strings. + operator which is also called as the string concatenation operator.

For example:

Using + Operator for concatenating String:

<Html>
<Head>
<Title>Demo Program – To Concatenating (+) Operators in JavaScript </Title>
</Head>
<Body>
<script language=”javascript” type=”text/
javascript”>
var String1 = “Java”;
var String2 = “Script”;
var String3=String1+String2;
document.write(“<br>String1 : “+Strlngl);
document.write(“<br>String2 : “+String2);
document.write/”<br> <br>Concatenated String
of String! and String2 : “+String3);
</script>
</Body>
</Html>

OUTPUT:

shaalaa.com
Javascript Operators and Expressions
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 14: Introduction to Javascript - Evaluation [पृष्ठ ३१४]

APPEARS IN

सामाचीर कलवी Computer Applications [English] Class 11 TN Board
अध्याय 14 Introduction to Javascript
Evaluation | Q 3. | पृष्ठ ३१४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×