Giter Club home page Giter Club logo

javascript-equality-table's Introduction

javascript-equality-table's People

Contributors

anders avatar dorey avatar eos87 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

javascript-equality-table's Issues

publishing your equality chart(s) in a book?

I am writing a series of JS books called "You Don't Know JS", here:

https://github.com/getify/You-Dont-Know-JS

The next title, which I'm about to begin, is "Types & Grammar", and I wanted to know if you'd be willing to let me publish (with attribution, of course) an image-form of your chart(s) in the book?

The books are released CC-NC-ND 3.0 (free, non-commercial, non-derivative) online in that repo, and are then being published traditionally (print and ebook form) through O'Reilly.

If so, I'd be grateful, as I think it's a great visualization for the topic. Thanks for your time! :)

Add Boolean object to the table

The Boolean object seem to get cast when using == but not when using ===.

ex.
new Boolean(true) == true // -> true
new Boolean(true) === true // -> false
new Boolean(false) == false // -> true
new Boolean(false) === false // -> false

Consider adding "Infinity"

NaN == NaN being false is very weird, but at least Infinity == Infinity is true! if()ing Infinity is also true, as is if(-Infinity).

Top-down text

The text above the columns should, in my opinion, no longer be generated with <canvas> tags. Instead, because CSS has the writing-mode property, it can be used. If set to vertical-rl, the text will be still rotated, but also accessible to screen readers.

Colors are not color blind safe

The red and green used in the tables is not color blind safe. A color blind user can tell that there are two colors being used, but they can not tell which color is red and which color is green.

White space

Something that I came up against recently, whitespace compared for equality with 0 resolves to true. It's not the same as an empty string because empty string and white space don't compare equally with empty array for example. So I think white space could legitimately be included in the table.

'\n\t ' == 0 true
'\n\t ' == [] false
'' == [] true

Maybe add one or more of the following values, which add to the wierdness?!

'0X0'
'1E0'
1E-1111
['Infinity']

'0X0' : string that is hex for zero if converted to Number
'1E0' : Exponential notation for one if converted to Number
1e-1111 : underflow (zero)
['Infinity'] : ['Infinity'] == Infinity

PS: Thanks for the grid, it is a great reminder of the evils of ==.

PPS: Not to mention 077 versus 088 (ouch - octal!).

PPPS: An == or === symbol inside the green cells of the grids made it clearer to me (using developer toolbar).

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.