- //Arrow function
- const add = (a, b) => a + b;
- console.log("the sum of two numbers is " + add(1, 20));
- //object
- const obj = {};
- obj.name = "john";
- obj.age = 20;
- console.log("The name is " + obj.name);
- console.log("The age is " + obj.age);
- //Destructuring
- const person = {
- pname: "John",
- pAge: 20,
- address: {
- city: "hyderabad",
- pin: 500047,
- },
- };
- const { pname, pAge, address: { city, pin } } = person;
- console.log("The name is " + pname + " and age is " + pAge);
- console.log("The address is " + city + " . pincode " + pin);
[text] we progs
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: