JSFiddle - React, Tailwind, and code Playground
by Nidhi Patel
JavaScript
/* var x = 3 ;
function func(y){
if(y){
var x = Math.random()
return x;
}
return x;
}
console.log(func(false)); */
/* const SENTENCE = 'How are you?';
const REVERSED_SENTENCE = (() => {
// Iteration over the string gives us code points
// (better for reversal than characters)
const arr = [...SENTENCE];
arr.reverse();
console.log(arr.join(''));
})(); */
var person = {
firstName: 'Jimmy',
lastName: 'Smith'
};
Object.defineProperty(person, 'age', {
value: 42,
});
person.age= 99;
console.log(person.age);