This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add(a, b) { | |
return a + b; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let add = function(a, b) { | |
return a + b; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Marks the path as having pending changes to write to the db. | |
* | |
* _Very helpful when using [Mixed](./schematypes.html#mixed) types._ | |
* | |
* ####Example: | |
* | |
* doc.mixed.type = 'changed'; | |
* doc.markModified('mixed.type'); | |
* doc.save() // changes to mixed.type are now persisted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = "Saravanan Sampathkumar"; | |
function getName() { | |
console.log(name); | |
} | |
getName(); // returns Saravanan Sampathkumar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = "Saravanan Sampathkumar"; | |
function getName() { | |
var name; | |
console.log(name); | |
name = "Saravanan"; | |
} | |
getName(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name = "Saravanan Sampathkumar"; | |
function getName() { | |
console.log(name); | |
var name = "Saravanan"; | |
} | |
getName(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name; // declaration | |
name = "Saravanan Sampathkumar"; // Initialization or Assignment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createSelector } = require('reselect'); | |
const cart = { | |
items: [ | |
{ name: 'Item 1', value: 200, in_stock: true }, | |
{ name: 'Item 2', value: 100, in_stock: false }, | |
{ name: 'Item 3', value: 200, in_stock: true }, | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cart = { | |
items: [ | |
{ name: 'Item 1', value: 200, in_stock: true }, | |
{ name: 'Item 2', value: 100, in_stock: false }, | |
{ name: 'Item 3', value: 200, in_stock: true }, | |
] | |
} | |
// Using traditional javascript | |
const inStock = items => items.filter(item => item.in_stock); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cart = { | |
items: [ | |
{ name: 'Item 1', value: 200, in_stock: true }, | |
{ name: 'Item 2', value: 100, in_stock: false }, | |
{ name: 'Item 3', value: 200, in_stock: true }, | |
] | |
} | |
// Using traditional javascript | |
const inStock = items => items.filter(item => item.in_stock); |
NewerOlder