Java Scripts Notes: 1. Use - Operator To Default Values
Java Scripts Notes: 1. Use - Operator To Default Values
Var color=’red’;
2. Template literal
Use template literal (tick operator) to define string across new line
` my name
Is
${person.name}.
`
3. Rest Operator
Set fulName(value)
{
If(typeof value !== ‘string’)
throw new Error(‘not valid input’)
7. Let vs var
Var => function – scoped variable
(ES6 specification )Let, const => block scoped variable
8. This
This represent the object that is executing the current function
Function is part of object (Method) object
Function --? Global (windows, global)
When you call function using New keyword, JS creates empty object and use this to point this
new object
9. Array function
courses.find( function(courses){
return courses.name === 'c';
})
11. Arguments
12. Factory/constructor Function (Pattern to create object)
14.
15. Add object property
16.
Define property