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 arr = [4, 5, 6]; // iterable object | |
const iterator = arr[Symbol.iterator](); | |
console.log(iterator.next()); // {value: 4, done: false} | |
console.log(iterator.next()); // {value: 5, done: false} | |
console.log(iterator.next()); // {value: 6, done: false} |
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 arr = [4, 5, 6]; // iterable object | |
for (const v of arr) { // iterates over the arr | |
console.log(v); | |
} | |
// 4, 5, 6 |
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 express = require('express'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
app.use(express.urlencoded({extended: true})); | |
app.use(express.json()); | |
mongoose.connect('mongodb://localhost/test', (err) => { | |
if (err) throw err; | |
console.log('Mongoose connected!'); |
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 express = require('express'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
app.use(express.urlencoded({extended: true})); | |
app.use(express.json()); | |
mongoose.connect('mongodb://localhost/test', (err) => { | |
if (err) throw err; | |
console.log('Mongoose connected!'); |
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 express = require('express'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
app.use(express.urlencoded({extended: true})); | |
app.use(express.json()); | |
mongoose.connect('mongodb://localhost/test', (err) => { | |
if (err) throw err; | |
console.log('Mongoose connected!'); |
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 express = require('express'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
app.use(express.urlencoded({extended: true})); | |
app.use(express.json()); | |
mongoose.connect('mongodb://localhost/test', (err) => { | |
if (err) throw err; | |
console.log('Mongoose connected!'); |
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 express = require('express'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
app.use(express.urlencoded({extended: true})); | |
app.use(express.json()); | |
mongoose.connect('mongodb://localhost/test', (err) => { | |
if (err) throw err; | |
console.log('Mongoose connected!'); |
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
try { | |
const news = await getAllNews(input); | |
} catch (err) { | |
console.log(err.message); // automatic generated message for getAllNews function | |
} |
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
import { StyleSheet } from 'react-native'; | |
StyleSheet.create({ | |
redBox: { | |
width: 25, | |
height: 25, | |
backgroundColor: 'red', | |
} | |
}); |
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
#redBox { | |
width: 25px; | |
height: 25px; | |
background-color: red; | |
} |