first and last char vowel reg exp same char
var re = /^([aeiou]).*\1$/
Here is what the above code is Doing:
1. The first line is a comment.
2. The second line is a regular expression.
3. The third line is a comment.
var re = /^([aeiou]).*\1$/
Here is what the above code is Doing:
1. The first line is a comment.
2. The second line is a regular expression.
3. The third line is a comment.
let promise = fnThatYouWannaCheck(); if(promise && typeof promise.then === ‘function’ && promise[Symbol.toStringTag] === ‘Promise’) { // is compliant native promise implementation } else { throw new Error(‘async function expected’); } Here is what the above code is Doing: 1. It checks if the function returns a promise. 2. It checks if the promise has a…
textAlign:’right’ Here is what the above code is Doing: 1. We’re creating a new variable called ‘my_style’ and setting it equal to a dictionary. 2. We’re setting the ‘font-size’ key to ’18px’ 3. We’re setting the ‘font-style’ key to ‘italic’ 4. We’re setting the ‘color’ key to ‘#F00’ 5. We’re setting the ‘text-align’ key to…
npm install @stripe/stripe-js Here is what the above code is Doing: 1. Importing the Stripe object from the stripe-js library. 2. Creating a Stripe object with your publishable API key. 3. Creating a card element and mounting it to the DOM. 4. Adding an event listener to the card element to listen for changes. 5. When the…
const miliseconds = 1604395966369; const date = new Date(miliseconds); Here is what the above code is Doing: 1. We create a variable called miliseconds and assign it a value of 1604395966369. 2. We create a variable called date and assign it a new Date object. 3. We pass the miliseconds variable as an argument to…
// next.config.js module.exports = { images: { domains: [‘images.unsplash.com’], }, } // pages/your_page_file.js Here is what the above code is Doing: 1. We’re using the Next.js image component to load the image. 2. We’re using the src attribute to specify the image URL. 3. We’re using the width and height attributes to specify the image…
// https://www.npmjs.com/package/react-native-picker-select // npm install react-native-picker-select //# React Native users //npm install @react-native-picker/picker //npx pod-install //# Expo //expo install @react-native-picker/picker import RNPickerSelect from ‘react-native-picker-select’; export const Dropdown = () => { return ( console.log(value)} items={[ { label: ‘Football’, value: ‘football’ }, { label: ‘Baseball’, value: ‘baseball’ }, { label: ‘Hockey’, value: ‘hockey’ }, ]} />…