Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript diffence between a++ and ++a

// ++i returns the value of i after it has been incremented. i++ returns the value of i before incrementing.

// When the ++ comes before its operand it is called the "pre-increment" operator, and when it comes after it is called the "post-increment" operator.

// This distinction is only important if you do something with the result.

var i = 0, j = 0;

alert(++i);  // alerts 1
alert(j++);  // alerts 0
Comment

PREVIOUS NEXT
Code Example
Javascript :: transaction commit rollback nodejs 
Javascript :: ckeditor ignore contenteditable 
Javascript :: cogo toast react 
Javascript :: javascript this Inside Function with Strict Mode 
Javascript :: window width onload jquery 
Javascript :: javascript use class without instantiating 
Javascript :: unexpected token w in json at position 0 
Javascript :: toggle function in javascript 
Javascript :: hammerjs 
Javascript :: is focus vanilla javascript 
Javascript :: define methods of objects in javascript 
Javascript :: Material-ui Adb icon 
Javascript :: remove last tag in dom javascript 
Javascript :: length of array 
Javascript :: juqery get label text 
Javascript :: atoi javascript 
Javascript :: react multiple classname 
Javascript :: how to live reload a node js app 
Javascript :: swiper js 
Javascript :: node.js http server 
Javascript :: openstreetmap api example javascript 
Javascript :: how to get the children of an element in cypress 
Javascript :: AJAX - Server Response 
Javascript :: Jest DOM Manipulation 
Javascript :: anagram javascript 
Javascript :: convert Component Did mount into useEffect 
Javascript :: javascript catch all click events 
Javascript :: components should be written as a pure function 
Javascript :: how to use axios 
Javascript :: class in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =