The Scotch.io public API sits at:
You can filter, sort, and include relationships using query params. There's more docs below but the URL you'll most likely use is:
https://scotch.io/api/f/posts?sort=-published_at&include=author,stats,tags,category
The Scotch.io public API sits at:
You can filter, sort, and include relationships using query params. There's more docs below but the URL you'll most likely use is:
https://scotch.io/api/f/posts?sort=-published_at&include=author,stats,tags,category
| "🔥✨🚀".repeat(10); |
| // 1. we have a string | |
| const myString = 'hi there. '; | |
| // 2. repeat over it 5 times | |
| const repeatedString = myString.repeat(5); | |
| // 3. output: hi there. hi there. hi there. hi there. hi there. | |
| console.log(repeatedString); |
| const myUrl = 'this\-is\-my\-url'; | |
| // myMessage.replace(/\\-/g, '-'); | |
| // or | |
| const newUrl = myUrl.replace(new RegExp('\-', 'g'), '-'); | |
| console.log(newUrl); // this-is-my-url |
| const myMessage = 'this is the sentence to end all sentences'; | |
| const newMessage = myMessage.replace(new RegExp('sentence', 'g'), 'message'); | |
| console.log(newMessage); // this is the message to end all messages |
| const myMessage = 'this is the sentence to end all sentences'; | |
| const newMessage = myMessage.replace(/sentence/g, 'message'); | |
| console.log(newMessage); // this is the message to end all messages |
| const myMessage = 'this is the sentence to end all sentences'; | |
| const newMessage = myMessage.replace('sentence', 'message'); | |
| console.log(newMessage); // this is the message to end all sentences |
| // 1. we have a sentence | |
| const message = 'This is my store. In my store we store store store.' | |
| // 2. replace all store with shop using a regular expression | |
| // normally .replace() will only replace the 1st occurrence | |
| const newMessage = message.replace(new RegExp('store', 'g'), 'shop'); | |
| // 3. output: This is my shop. In my shop we shop shop shop. | |
| console.log(newMessage); |
| // 1. we have a url | |
| const url = "http://scotch.io"; | |
| // 2. replace http: with https: | |
| const httpsUrl = url.replace("http:", "https:"); | |
| // 3. output: https://scotch.io | |
| console.log(httpsUrl); |
| // 1. create a message | |
| const message = 'This is my message.'; | |
| // 2. replace message with new thing | |
| // this creates a brand new string. does not change the original variable (message) | |
| const newMessage = message.replace('message', 'new thing'); | |
| // 3. output: This is my new thing. | |
| console.log(newMessage); |