Code Monkey home page Code Monkey logo

Comments (5)

skatcat31 avatar skatcat31 commented on June 13, 2024

What do you mean by removing duplicates from an array?

from 30-seconds-of-css.

Ritwik880 avatar Ritwik880 commented on June 13, 2024

Removing items from an array, especially if those items are arrays themselves.

const array = [1, 1, 1, 3, 3, 2, 2];

const unique = [...new Set(array)];
 

const unique = array.reduce((result, element) => {
return result.includes(element) ? result : [...result, element];
}, []);
 

const unique = array.filter((element, index) => {
return array.indexOf(element) === index;
});

from 30-seconds-of-css.

skatcat31 avatar skatcat31 commented on June 13, 2024

That's JavaScript, not CSS

from 30-seconds-of-css.

Ritwik880 avatar Ritwik880 commented on June 13, 2024

What about the other two?

from 30-seconds-of-css.

Chalarangelo avatar Chalarangelo commented on June 13, 2024
  1. Media Queries for Standard Devices

We have discussed this in the past, we will not be implementing this as what is considered standard devices changes quite often. Additionally, the idea of a standard device media query is somewhat outdated as developers are encouraged to develop with features in mind, instead of limiting themselves to standard device media querying.

  1. Lazy loading images

This one might be more suited for a blog post than anything else, as it requires some explaining and details that might not fit well in the snippet format.

  1. Remove duplicates from an array

JS snippet, already implemented as uniqueElements.

from 30-seconds-of-css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.