Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript increment pre increment

let a = 2
let b = a++

console.log(a, ' - ', b)	// [Log]: 3 - 2

a = 2
b = ++a

console.log(a, ' - ', b)	// [Log]: 3 - 3
Comment

example of pre increment in js

let a = 2;
b = ++a;

// a = 3
// b = 3
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to store an entire object in cookies javascript 
Javascript :: Nullish Coalescing Vs Logical OR opreators 
Javascript :: scrollto js 
Javascript :: run jest on single file 
Javascript :: Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type 
Javascript :: click on a radio button using jquery 
Javascript :: sequelize update column type 
Javascript :: react yup password with number string and uppercase 
Javascript :: get file extension node 
Javascript :: chrome extension get current tab from popup 
Javascript :: vuejs bootsrap modal hidden event 
Javascript :: truncate a string js 
Javascript :: select by style in jquery 
Javascript :: count number of word in javascript 
Javascript :: mongodb sort query 
Javascript :: js get clipboard data 
Javascript :: check if url is http or https javascript 
Javascript :: js window.alert 
Javascript :: reactbootstrap multiselect 
Javascript :: nodejs await inside map 
Javascript :: miles to metres 
Javascript :: javascript replace dash with space 
Javascript :: nextjs multer rename file 
Javascript :: javascript canvas reset transform 
Javascript :: react refresh 404 error 
Javascript :: async false in ajax 
Javascript :: add sass to react 
Javascript :: @angular/common@11.2.1 node_modules/@angular/common @angular/common@"11.2.1" from the root project 
Javascript :: install react router dom with npm 
Javascript :: add class to element javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =