Modules and namespaces in JavaScript 🧵👇
Once we have a class that we want to resue, we can simply export them using the export statement.
We can export classes, variables, and functions by using an inline export statement like this.
export default class user;
Another common JavaScript import format you might have seen is:-
import { calculateAge, displayName } from './user.js';
The difference between this and
import user from './user.js';
is because the user class is exported as default.
What the heck is IIFE?
But why do we need IIFEs and why do we need to execute a function immediately?
Do we need IFFEs in ES6?
👇
https://t.co/1GujeROLE3
2⃣ Use the getDate instance method to get a timestamp.
3⃣ Add the n into the new timestamp
4⃣ Convert into date format using setDate instance method.
5⃣ Make it human-readable using the toLocaleDateString() instance method
#javascript
How to check if a string contains another word in PHP?
✔️Using strpos() function
✔️Using substr_count() php function
✔️Using strstr() function
✔️Using regular expression
✔️Using str_contains() PHP 8 function
https://t.co/6P7kr1oj6V
✔️Have a CTA
✔️Have an easy navigation menu
✔️Provide Contact Information
✔️Is your website responsive?
✔️Sensible Content First
✔️Secure domain
✔️Use the power of social media.
✔️Search
https://t.co/yoel79AmFW