What does +_ operator mean in JavaScript ? Last Updated : 06 Jan, 2023 Comments Improve Suggest changes Like Article Like Report Unary Operator: A unary operation contain only one operand. Here, the '+' unary plus operator converts its operand to Number type. While it also acts as an arithmetic operator with two operands which returns an addition result on calculation. JavaScript Identifiers: Javascript Identifiers are used to name variables (and keywords, functions, and labels). In Javascript, the first character must be a letter, or an underscore ( _ ), or a dollar sign ( $ ) but not a digit and subsequent characters may be letters, digits, underscores, or dollar signs.JavaScript +_ operator: It is a combination of the variable with the symbol underscore( _ ) and unary plus ( + ) operator, + operator converts the type of _ variable to Number type for further operation. Example: The variable "_" with string type is stored in variable "r" with "number" type. Input: var _ = "1"; var r = +_; Output: typeof(r) will be number Example 1: Conversion of String to Number HTML <body style="text-align:center"> <div class="container"> <h1 style="color:green">Geeks for Geeks</h1> <h3> Javascript Operator </h3> <p align="center"> Type of variable(_) : <span id="gfg"></span> <br /> Type of variable(a) : <span id="gfg1"></span> </p> <script type="text/javascript"> GFG = function (_) { let b = typeof _; let a = +_; let c = typeof a; document.getElementById("gfg").innerHTML = b; document.getElementById("gfg1").innerHTML = c; }; GFG("21"); </script> </div> </body> Output: +_ operator in JavaScript Example 2: Performing arithmetic addition operations by converting them to number type. HTML <body style="text-align:center"> <div class="container"> <h1 style="color:green"> GeeksforGeeks </h1> <h3> Addition Operation </h3> <p align="center"> Value variable(_) : <span id="gfg"></span> <br /> Value of variable($) : <span id="gfg1"></span> <br /> Value of variable(Sum) : <span id="gfg2"></span> </p> <script type="text/javascript"> GFG = function (_, $) { let c = +_ + +$; let a = +_; let b = +$; document.getElementById("gfg").innerHTML = a; document.getElementById("gfg1").innerHTML = b; document.getElementById("gfg2").innerHTML = c; }; GFG("21", "45"); </script> </div> </body> Output: +_ operator in JavaScript Comment More infoAdvertise with us Next Article What does +_ operator mean in JavaScript ? A abhishekkharmale Follow Improve Article Tags : JavaScript Web Technologies javascript-operators JavaScript-Questions Similar Reads What does '...' mean in JavaScript? The '...' (or 3 dot symbol) in JavaScript is known as the Spread operator or Rest operator based on the usage. This syntax is used to expand the iterable into individual elements such as arrays, objects, etc.Syntax for Spread Operatorcosnt a1 = [ 10, 20, 30, 40 ];const a2 = [ ...a1, 50]; // Extracti 4 min read Left Shift (<<) Bitwise Operator in JavaScript JavaScript Left Shift Operator is used to operate on the two operands. The first operand is the number and the right operand specifies the number of bits to shift to the left. The operation is represented by the "<<" symbol. Mainly the left shift operator is used to multiply the number by any 2 min read JavaScript Addition (+) Operator JavaScript addition (+) operator is one of the most fundamental and widely used arithmetic operators in JavaScript. It is used to perform arithmetic addition on numbers but also concatenate strings. Syntaxa + bWhere - a: The first value (number, string, or another data type).b: The second value (num 1 min read JavaScript Grouping Operator The Grouping operator consists of a pair of parentheses around an expression or sub-expression to override the normal operator precedence so that expressions with lower precedence can be evaluated before an expression with higher priority. This operator can only contain expressions. The parameter li 2 min read What are these triple dots (...) in JavaScript ? In JavaScript, there are multiple ways in which we can assign the value of one object to another. Sometimes we do not know the exact number of arguments that are to be assigned. In this case, the triple dots are used. The triple dots are known as the spread operator, which takes an iterable(array, 4 min read Like