You are on page 1of 2

S.

Janet Vidyaa Nancy

<!DOCTYPE html>
<body>
<script>
const num=(x)=> x*x;

console.log(num(38)); /* o/p:3364 */

const P=(number)=> number>0;


console.log(P(5)); /*true*/
console.log(P(-5)); /*false*/

const C=(str1,str2,str3)=>str1+" "+str2+" " +str3;


console.log(C("This","is","WiseLearnz")); /*This is WiseLearnz*/

const C=(str1,str2,str3)=>str1+str2+str3;
console.log(C("I","am","Janet")); /*IamJanet

const cArea=(length,width)=>length*width;
console.log(cArea(77,46)); /*3542*/

const cArea=(length,width,height)=>(length*width)/height;
console.log(cArea(77,46,2)); /*1771*/

const gR=(name)=>"Hello, " + name + '!';


console.log(gR("Vidyaa")); /*Hello, Vidyaa!*/

const fR=(n)=>{
if (n === 0 || n === 1)
{
return 1;
}
return n * fR(n - 1);
}
console.log(fR(8)); /*40320*/

console.log(fR(1)); /* 1 */

const fR=(n)=>{
return (n === 0 || n === 1) ? 1 : n * fR(n - 1);
}
console.log(fR(7)); /* 5040 */

const cR=(str)=> str.charAt(1).toUpperCase() + str.slice(1);


console.log(cR("atmosphere")); /*Ttmosphere*/

const cR=(str)=> str.charAt(7).toUpperCase() + str.slice(4);


console.log(cR("atmosphere good")); /* Esphere good
*/
</script>
</body>
</html>

You might also like