top of page
Simple Return-Function
Simple Return-Function
Here you will find 3 different RETURN-FUNCTIONS, which returns different results.
COUNTING-UP & DOWN
and multiplication
CODE
$w.onReady(function () {
//TODO: write your page related code here...
});
export function button1_click(event) {$w('#TXToutput').text = xxx(Number($w('#input1').value), Number($w('#input2').value)).toString()}
function xxx(p1, p2) {
return p1 * p2;
}
var COUNTER = 0
function count_up () {
COUNTER = COUNTER+1
console.log(COUNTER)
return COUNTER
}
var COUNTER2 = 10
function count_down () {
COUNTER2 = COUNTER2-1
console.log(COUNTER2)
return COUNTER2
}
export function BTNcountup_click(event) {
let myNewButtonLabel = count_up()
$w('#BTNcountup').label = myNewButtonLabel.toString()
}
export function BTNcountdown_click(event) {
let myNewButtonLabel = count_down()
$w('#BTNcountdown').label = myNewButtonLabel.toString()
}
bottom of page