{"id":13623844,"url":"https://github.com/yosuke-furukawa/iojs-new-features","last_synced_at":"2025-03-21T22:31:36.771Z","repository":{"id":31229834,"uuid":"34791035","full_name":"yosuke-furukawa/iojs-new-features","owner":"yosuke-furukawa","description":"iojs v3.0 released.","archived":false,"fork":false,"pushed_at":"2015-08-07T17:44:04.000Z","size":168,"stargazers_count":39,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-01T10:21:44.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yosuke-furukawa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-29T11:53:04.000Z","updated_at":"2024-05-15T07:49:02.000Z","dependencies_parsed_at":"2022-09-02T17:23:26.292Z","dependency_job_id":null,"html_url":"https://github.com/yosuke-furukawa/iojs-new-features","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yosuke-furukawa%2Fiojs-new-features","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yosuke-furukawa%2Fiojs-new-features/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yosuke-furukawa%2Fiojs-new-features/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yosuke-furukawa%2Fiojs-new-features/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yosuke-furukawa","download_url":"https://codeload.github.com/yosuke-furukawa/iojs-new-features/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244165226,"owners_count":20409052,"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-08-01T21:01:36.314Z","updated_at":"2025-03-21T22:31:36.270Z","avatar_url":"https://github.com/yosuke-furukawa.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# io.js v3.0 is released!!!!!!!\n\nio.js v3.0 new features.\n\n# ECMAScript 2015 - feature\n\ncurrent V8 version 4.4\nprevious V8 version 4.2\n\nIf you would like to see the changes, see [the following url](https://gist.github.com/rvagg/1f115074cb3c890985bf)\n\nhttps://gist.github.com/rvagg/1f115074cb3c890985bf\n\n## Computed property names\n\nComputed property names (`{['foo'+'bar']:'bam'}`) are shipped.\nNo need to specify any `harmony-` flag.\n\n```javascript\nvar i = 0;\nvar a = {\n  [\"foo\" + ++i]: i,\n  [\"foo\" + ++i]: i,\n  [\"foo\" + ++i]: i\n};\n\nconsole.log(a.foo1); // 1\nconsole.log(a.foo2); // 2\nconsole.log(a.foo3); // 3\n\nvar param = 'size';\nvar config = {\n  [param]: 12,\n  [\"mobile\" + param.charAt(0).toUpperCase() + param.slice(1)]: 4\n};\n\nconsole.log(config);\n```\n\n```\n$ iojs es6/computed_property/computedProps.js\n```\n\n## unicode\n\nUnicode escape sequence (`\\u{xxxxx}`) is shipped.\nNo need to specify `--harmony` option.\n\n```javascript\nconsole.log('\\u{1F363}'); // 🍣\nconsole.log('\\u{1F4A1}'); // 💡\n```\n\n```\n$ iojs es6/unicode/unicode.js\n```\n\n## Array subclass\n\nclass is already available, but previous version does not support built-in Array subclass. \n\nnote: we should put 'use strict' on top.\n\n```javascript\n// strict mode needed\n'use strict';\nclass ShuffleArray extends Array {\n  shuffle() {\n    var l = this.length;\n    var i;\n    var t;\n    while (l) {\n      i = Math.floor(Math.random() * l--);\n      t = this[l];\n      this[l] = this[i];\n      this[i] = t;\n    }\n    return this;\n  }\n}\n\nvar shuffleArray = new ShuffleArray();\nshuffleArray.push(1, 2, 3, 4, 5, 6);\nconsole.log(shuffleArray.shuffle()); // shuffled [4, 6, 3, 1, 5, 2]\n```\n\nprevious io.js is also available Array subclass. But they have an [issue](https://code.google.com/p/v8/issues/detail?can=2\u0026q=3930\u0026colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Area%20Stars\u0026id=3930). v8 fixed the problem.\n\n## Spread operator\n\nNow, we can use `Spread operator (...) `. \nBut we need to specify `--es_staging` arguments.\n\nThe spread operator allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) are expected.\n\n```javascript\n// Spread operator\nvar arr1 = [0, 1, 2];\nvar arr2 = [3, 4, 5];\narr1.push(...arr2); // we can use ...\nconsole.log(arr1);\n```\n\n```\n$ node --es_staging es6/spread_operator/spread.js\n```\n\n## Rest parameters\n\nRest parameters (`function(...args) {}`) are implemented in staging behind the `--es-staging` flag.\n\n```javascript\n// Rest parameters\nfunction max(...args) {\n  // rest parameter is not Array-like object, that is just array.\n  console.log(Array.isArray(args))  // true\n  console.log(args.length)          // 6\n\n  var max = args.reduce(function(max, n) { \n    return n \u003e max ? n : max;\n  });\n  return max;\n}\n\nvar maxNum = max(5, 15, 10, 1, 4, 5);\nconsole.log(maxNum); // 15\n```\n\n```\n$ iojs --es_staging es6/rest_params/rest.js\n```\n\n\n# REPL saves history by default\n\nREPL gets a history file. \nIn previous version, repl needs to specify `NODE_REPL_HISTORY_FILE`.\nBut current version, repl saves history by default.\n\n```\n$ iojs\n\u003e var fs = require('fs');\n# Ctrl-D\n$ iojs\n\u003e var fs = require('fs'); # push up button\n```\n\n# Buffer is subclass of Uint8Array\n\n```javascript\nconst Buffer = require('buffer').Buffer;\nconst ab = new ArrayBuffer(16);\nvar buf = new Buffer(ab); // Buffer constructor accepts ArrayBuffer.\n\nconsole.log(buf instanceof Uint8Array); // true\nconsole.log(buf instanceof Buffer); // true\n\nbuf.writeUInt32BE(0x61626364, 0);\n\nconsole.log(buf.toString()); //abcd\n```\n\n# Remove smalloc and Deprecate freelist\n\n`smalloc` module is removed.\n`freelist` module is now deprecated.\n\n# Want to know more??\n\nplease check the following issue.\n\nhttps://github.com/nodejs/io.js/blob/master/CHANGELOG.md#2015-08-04-version-300-rvagg\nhttps://github.com/nodejs/io.js/wiki/Breaking-Changes#300-from-2x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyosuke-furukawa%2Fiojs-new-features","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyosuke-furukawa%2Fiojs-new-features","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyosuke-furukawa%2Fiojs-new-features/lists"}