Code Monkey home page Code Monkey logo

array-explorer's Introduction

JavaScript Array Explorer

When I was first learning array methods, I spent a lot of time digging through the docs to find the appropriate one, and I had to search one by one. I made this resource to help people find the correct array method a bit more naturally. You can narrow down what you want to do and explore until you find what's most useful to you.

Check out the site here: https://arrayexplorer.netlify.com/

Or if you prefer codepen: https://codepen.io/sdras/full/gogVRX/

I realize that there are about a million ways that this resource can be set up, and some of the taxonomy is necessarily opinionated. I tried to focus on what I thought would have helped me learn the best, rather than industry standard delineations (mutator, accessor, iteration, for example). There are a lot of resources that already divide the methods this way, so if that style of learning suits you better, that's great! This resource is not set up that way. Please keep in mind that this is not meant to be as comprehensive or a replacement for full documentation, which is why the MDN docs are linked to in each method.

I based most of the examples and longer descriptions off of the MDN documentation, altering it slightly where I felt the description was not as beginner-friendly as it could be.

Enjoy!

Other Similar Projects

I have an Object Explorer as well: https://objectexplorer.netlify.com/

I've heard people say they want to fork this project for other languages and data types (ruby, etc), please feel free to! If you let me know about it, I'll link it up here.

Thank you!

Many thanks to everyone who helped with the translations! @AWolf81, @Gonzalo2310, @welll, @julienmartin, @g-plane, @imbyurhan, @bahe007, @salahaa1, @proYang, @bdimitrovski, @TheElderMindseeker, @glenngijsberts, @galuhsahid, @xgebi

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

array-explorer's People

Contributors

akashp1712 avatar bahe007 avatar bnb avatar byurhannurula avatar daniel-griffiths avatar darahak avatar dependabot[bot] avatar diogoteix avatar doubledare704 avatar g-plane avatar galuhsahid avatar gonzalo2310 avatar janiceshiu avatar julienmartin avatar jumpalottahigh avatar kant avatar kennethsinder avatar loremaps avatar meih avatar mrtnjln avatar muescha avatar nicolo-ribaudo avatar niladri24dutta avatar proyang avatar salahaa1 avatar sdras avatar theeldermindseeker avatar thejaredwilcurt avatar welll avatar zhammer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

array-explorer's Issues

reduceRight wrong example?

Hello,
I'm not sure, but in find items -> one item:

reduce returns sum of the array, as I'd expect, while reduceRight 'flatten' arrays. Shouldn't it be also sum?

Track down output issue

Three people on Chrome on a Mac had an issue with the output not showing up. I think it has to do with the timing of the scale in gsap. Need to investigate.

Change sort() example

As specified by the "Important note", .sort() does not always behave as expcted when using numbers.
I think that the example should either sort an array of strings or provide a compare function.

e.g.

arr.sort((x, y) => x > y ? 1 : -1)

excuse me...what it's is?

in store/index.js

const languages = (ctx => {
  ....
})(require.context("./", true, /[a-z]{2}/));

What are these things?
when I console.log(require.context) or console.log(require) it's get error
so Amazing...
this code Related to webpack? or vue?

thanks

Cloning an array

Awesome tool btw, thanks! I have been working up the courage to contribute open source and maybe this could be the start of it.

I had to recently clone an array for a work project.
I see that you have a feature to do that in the ObjectExplorer.

Could we look at adding one here too?

Possible typo in English version

In slice() method description of English version of the service, the text states:

The slice() method returns a shallow copy of a portion of an array into a new array object. You can specify either just the ending element (where begin will default to zero) or both the beginning and the end, comma-separated. The original array will not be modified.

But in fact, we cannot specify only ending element, but the beginning one. To prove my words I will refer to w3schools.com, admitting that the signature of the method is the following: slice(start, end), where both parameters are optional. The start parameter comes first, so we cannot specify end parameter leaving the former out.

Error due to bumping webpack-dev-server from 2.11.3 to 3.1.11

A PR (#97) was recently merged where we bumped the webpack-dev-server version from 2.11.3 to 3.1.11
This seems to cause some issues.
When running npm run dev
I get the error

The CLI moved into a separate package: webpack-cli
Please install 'webpack-cli' in addition to webpack itself to use the CLI
-> When using npm: npm i -D webpack-cli
-> When using yarn: yarn add -D webpack-cli
module.js:538
    throw err;
    ^

Error: Cannot find module 'webpack-cli/bin/config-yargs'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/km047841/myProjects/WebDev/array-explorer/node_modules/webpack-dev-server/bin/webpack-dev-server.js:84:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)

Even after installing webpack-cli, I still get the error

module.js:538
    throw err;
    ^

Error: Cannot find module 'webpack-cli/bin/config-yargs'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/km047841/myProjects/WebDev/array-explorer/node_modules/webpack-dev-server/bin/webpack-dev-server.js:84:1)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)

When I rolled back to webpack-dev-server 2.11.3, the error isn't there anymore. I'm no webpack expert, but I imagine it has to do with some changes needed in the webpack config for the latest webpack-dev-server. Maybe even webpack 4. I'll investigate more. Maybe use this as a way to learn about webpack, but obviously, if someone else/Sarah knows the solution or can figure it out quicker, feel free to fix it :)

UX improvement: display as list instead of dropdown

Hi, when I choose a dropdown, then I need to click on another dropdown to see the full list, it's quite inconvenient.
I think it's better that when I choose a dropdown, it will display the next list on UI (e.g. with ul li tags) so that I can view and can click to choose the option.

Immutable examples?

Hi,
Great work with this project! Would you consider adding immutable examples too? I could try to help

Amazing tool!!! URL params as a feature?

I was hoping to turn this tool into an Alfred extension, and the only way I can see to do that is to possibly deal with query params from the URL. Would you be interested in adding this to the current version?

Something like selecting "I would like to "add…" and "element/s to an array" would result in the URL as follows: https://sdras.github.io/array-explorer/add/?splice. Thoughts?

Latest language details

The line code numbers are approximate
src/App.vue
line 7: 'Array Explorer' Although this text could be the name of the application. In that case it should not be translated

line 8: 'Find the array method you need without digging through the docs'
line 12: 'Usage'

src/components/AppCode.vue
line 14: 'Output'

src/components:MethodBase.vue
line 5: 'see the docs'

It's not important or urgent. It's just details to leave it 100% translated.

Can you provide reverse operation

Can you provide reverse operation
For example, I choose Array.unshift()
result is:
I have an array, I would like to ....
I need to ad...

tks..

typo bug

In codepen...
captura de pantalla 2017-12-29 a la s 10 05 32
but I saw code is ok. ¯_(ツ)_/¯

Experiments with the snippet

Hi

Maybe you should allow user to play and experiments with snippet in "usage" and see the result in "output". So new javascript user could easily try these functions.

Browser Support or ECMAScript Specification Warning

The tool contains array methods from ES5 up to ES7. A lot of these methods wouldn't work in IE11 for instance. Either the ECMAScript version or a ES6+ warning could let users know if they use said method they'd have to use a polyfill for pre-evergreen browser support or Node.js 4 or earlier.

As a newbie who comes across this site, I would like to know which programming language is being used.

Currently, it doesn't mention JavaScript anywhere, so someone with no context wouldn't know which programming language this tool is using.

The readme mentions the possibility of adding additional programming language support, but for now, since it's only JavaScript, perhaps change the text from Array Explorer to JavaScript Array Explorer.

Either way, this is an amazing tool. Thanks so much for building it!

indexOf: fromIndex

I feel like indexOf's optional second parameter: fromIndex, is an unsung hero.

It has saved me many times from having to slice an array before calling indexOf.

Would you consider a PR with an example using fromIndex?

Create a language switcher

There's been a lot of interest supporting a bunch of different languages, and the first PR is in, so I need to build out a language switcher for the repo.

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.