ES6 added a spread operator to JavaScript.
function choose(choice, ...availableChoices) {
return availableChoices[choice];
}
choose(2, "one", "two", "three", "four");
// returns "three"
More Related Contents:
- How do I find what is common between 2 lists? [duplicate]
- Error tells me I need JavaScript
- Javascript equivalent of Python’s zip function
- Can scrapy be used to scrape dynamic content from websites that are using AJAX?
- Django Template Variables and Javascript
- Running javascript in Selenium using Python
- JSON datetime between Python and JavaScript
- Call Python function from JavaScript code
- How to convert raw javascript object to a dictionary?
- Pass parameter with Python Flask in external Javascript
- Rendering to JS with Jinja produces invalid number rather than string
- Passing Python Data to JavaScript via Django
- Pass JavaScript variable to Flask url_for
- Python library for rendering HTML and javascript [closed]
- How do I wait for a JavaScript __doPostBack call through Selenium and WebDriver
- Call python function from JS
- How to call python script from NodeJs
- How to decrypt password from JavaScript CryptoJS.AES.encrypt(password, passphrase) in Python
- How can I pass parameter through serialization and then parse them using external JavaScript?
- How to get html with javascript rendered sourcecode by using selenium
- How do I download a file from FastAPI backend using Fetch API in the frontend?
- How do i take picture from client side(html) and save it to server side(Python)
- Flask Dynamic data update without reload page
- Click on a javascript link within python?
- How to set up Python server side with javascript client side
- Can I scrape the raw data from highcharts.js?
- Hide several lines using Checkboxes and CustomJS in Python Bokeh
- Get data from html and and pass the data back to the front end using ajax or js
- Selenium: How to Inject/execute a Javascript in to a Page before loading/executing any other scripts of the page?
- Python Flask Cors Issue