JSFiddle - React, Tailwind, and code Playground
by Rijo R
JavaScript
// function return an object
/*var x;
console.log(x);
if(typeof x === 'undefined') {
console.log('true');
}
console.log(y);
var y = 1;
if(function foo() {}){
y += typeof foo;
}
console.log(y);
console.log(typeof function f(){}); */
function showName(fname,lname) {
var fullname = " my Name";
var a = [5,4,5,7], i=0;
function fullNameFun() {
i++;
return fullname = fname + lname + fullname + 'array' + a[i];
}
return fullNameFun();
}
console.log(showName('Michel', 'shoow'));
console.log(showName('Michel', 'shoow'));
console.log(showName('Michel', 'shoow'));
function Celibrate() {
var celid = 587;
return {
getId: function() {
return celid;
},
setId: function(newid) {
celid = newid;
return celid;
}
}
}
var celibrate = Celibrate();
console.log(celibrate.getId());
console.log(celibrate.setId(57));
console.log(celibrate.getId());