GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Updated README · MorrielAlexis/JavaScript-Lessons@8cebee4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • ES6/Spread_Operator
    • main.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎ES6/Spread_Operator/main.js‎

Copy file name to clipboardExpand all lines: ES6/Spread_Operator/main.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@ function addNumbers(a, b, c){
44
console.log(a + b + c);
55
}
66

7-
var nums = [1, 2, 3];
7+
// expand array into function arguments
8+
var nums = [3, 4, 5];
89
addNumbers(...nums);
10+
11+
// used to combine arrays
12+
var meats = ['bacon', 'ham'];
13+
var food = ['apples', ...meats, 'kiwi', 'rice'];
14+
console.log(food);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.