{"id":15497213,"url":"https://github.com/jwerle/secret-nan","last_synced_at":"2025-09-03T06:34:35.757Z","repository":{"id":148540550,"uuid":"59697211","full_name":"jwerle/secret-nan","owner":"jwerle","description":"NaN - the true singleton (and the hax that you can conceive)","archived":false,"fork":false,"pushed_at":"2016-05-25T21:11:32.000Z","size":2,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T03:17:53.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwerle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-05-25T20:58:36.000Z","updated_at":"2016-05-26T13:40:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9df7898-6760-48c2-bf9f-880fa40a4465","html_url":"https://github.com/jwerle/secret-nan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jwerle/secret-nan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fsecret-nan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fsecret-nan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fsecret-nan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fsecret-nan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwerle","download_url":"https://codeload.github.com/jwerle/secret-nan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Fsecret-nan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273403937,"owners_count":25099299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T08:32:06.670Z","updated_at":"2025-09-03T06:34:35.750Z","avatar_url":"https://github.com/jwerle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"NaN secrets\n===========\n\n`NaN` is a special value in javascript. It is one of few built in values\nthat can represent a true invariant. `NaN` is a `number`, or a `Number`\ninstance. Every `prototype` property (scalar, method, object) on the\n`Number` prototype is inherited by `NaN`. `NaN` with the help of a\n`Symbol` can enclose values only accessible to occurences of `NaN`. We\ncan achieve this by adding a `.set(key, value);` method to the\n`Number.prototype` object.\n\n```js\nNaN.set('kinkajou' 'bradley')\n(4).set('monkey', 'brian')\n0xff.set('cat', 'sienna')\n0..set('dog', 'apollo')\n\nconsole.log(NaN.kinkajou); // 'bradley'\nconsole.log((4).monkey); // undefined\nconsole.log(0xff.cat); // undefined\nconsole.log(0..dog); // undefined\n```\n\n## or ...\n\n ... you could probably do this with any built-in scalar like\n`{ -Infinity, ..., -1, 0, 1, ..., +Infinity }` or `true, false` with the\nexception of `null` and `undefined`\n\n## anyways ...\n\n... yolo\n\n## more ...\n\n* https://www.smashingmagazine.com/2011/05/10-oddities-and-secrets-about-javascript/\n* http://www.programering.com/a/MDNxcjNwATk.html\n* http://ariya.ofilabs.com/2014/05/the-curious-case-of-javascript-nan.html\n\n## license\n\ndo wtf ever... *MIT*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fsecret-nan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwerle%2Fsecret-nan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Fsecret-nan/lists"}