“substraction js” Réponses codées

Comment faire de la soustraction en javascript

//To subtract in Java script, you have to put an subtraction symbol '-' between them. If you have stored two numbers in variables, just put an subtraction symbol between the variable names.
//For example:
var a = 6
var b = 5
var c = a-b
var d = 6-5

Bot.send (c)/ print (c)// or whatever you use to get output
Bot.send (d)/ print (d)// or whatever you use to get output

//output will be: 1, 1
Your help :P

substraction js

// Sometimes we need to substract values from a form. 
// Those come in as strings. So we need to convert them first. 
// We can do this with Number(). 
var c = Number($_POST['a']) - Number($_POST['b']); 
// or 
var c = Number($_GET['a']) - Number($_GET['b']);
// or FLOAT 
var c = Number.parseFloat($_POST['a']) - Number.parseFloat($_POST['b']); 
// or 
var c = Number.parseFloat($_GET['a']) - Number.parseFloat($_GET['b']);
// or INTEGER 
var c = Number.parseInteger($_POST['a']) - Number.parseInteger($_POST['b']); 
// or 
var c = Number.parseInteger($_GET['a']) - Number.parseInteger($_GET['b']);
freshMan

Réponses similaires à “substraction js”

Questions similaires à “substraction js”

Plus de réponses similaires à “substraction js” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code