{"id":16920800,"url":"https://github.com/dherault/javascript_x","last_synced_at":"2025-10-11T21:33:52.307Z","repository":{"id":42580626,"uuid":"55911775","full_name":"dherault/JavaScript_x","owner":"dherault","description":"Advanced JavaScript stuff","archived":false,"fork":false,"pushed_at":"2016-11-10T15:00:39.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-25T19:44:43.890Z","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":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dherault.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}},"created_at":"2016-04-10T17:06:02.000Z","updated_at":"2024-03-27T16:34:38.000Z","dependencies_parsed_at":"2022-09-13T05:52:59.620Z","dependency_job_id":null,"html_url":"https://github.com/dherault/JavaScript_x","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dherault%2FJavaScript_x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dherault%2FJavaScript_x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dherault%2FJavaScript_x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dherault%2FJavaScript_x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dherault","download_url":"https://codeload.github.com/dherault/JavaScript_x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244706545,"owners_count":20496571,"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","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-13T19:49:37.550Z","updated_at":"2025-10-11T21:33:47.277Z","avatar_url":"https://github.com/dherault.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript_x\n\nAdvanced JavaScript stuff\n\n### Strict mode\n\nRestricted version of JavaScript that disallows some of te more problematic or error-prone features.\nThe syntax is still backward compatible.\n\n### Numbers\n\n64-bit encoded numbers (IEEE 754 standard). Integers can be represented with upto 53 bits of precision.\n2^-53 (-9,007,199,254,740,992) to 2^53.\nBUT bitwise arithmetic operators convert their argument into 32-bit integers (big-endian, two's complement).\n\nIn JS real numbers are not associative: \n```javascript\n(0.1 + 0.2) + 0.3 === 0.1 + (0.2 + 0.3); // false\n```\n\n### Implicit coercions\n\n`3 + true; // 4`\n\nBitwise operations convert args to 32-bit integers `\"8\" | \"1\"; // 9`;\n\n#### NaN\n\n```javascript\nisNan(NaN); // true\nisNan('foo'); // true --\u003e pb\n\n// But since NaN is the only object that does:\nNaN === NaN; // false\n\n// We can do:\nfunction isReallyNaN(x) {\n  return x !== x; \n}\n```\n\n#### toString and valueOf\n\nvalueOf is prefered over toString in string coercions. \n\n```javascript\nconst x = {\n  toString: () =\u003e 'yolo', // string coercion\n  valueOf: () =\u003e 42, //number coercion\n};\n\n'hello' + x; // hello 42\n```\n\n#### 7 falsy values\n\n```javascript\nconst falsies = [false, 0, -0, '', NaN, null, undefined];\n\n// sometimes, go for\nif (typeof x !== 'undefined') // ...\n// or\nif (typeof x === undefined) // ...\n```\n\n### Primitives\n\n5 primitives: booleans, numbers, strings, `null`, `undefined`. Even if\n```javascript\ntypeof null; // 'object'\n```\nStrings:\n```javascript\nconst s1 = 'Where is my umbrella?';\nconst s2 = new String('Near the door');\nconst s3 = new String('Near the door');\n\ntypeof s1; // 'string'\ntypeof s2 // 'object'\ns1 == s2; // false\ns2 === s3; // false\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdherault%2Fjavascript_x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdherault%2Fjavascript_x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdherault%2Fjavascript_x/lists"}