Feast 2.0!
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

24 строки
581 B

  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. declare global {
  4. interface Array<T> {
  5. joinGeneral (item: T, endItem: T|null): Array<T>;
  6. }
  7. }
  8. /* eslint-disable-next-line */
  9. Array.prototype.joinGeneral = function (item, endItem = null) {
  10. if (endItem === null) {
  11. return this.slice(0, -1).flatMap(x => [x, item]).concat(this.slice(-1))
  12. } else {
  13. return this.slice(0, -2).flatMap(x => [x, item]).concat(this.slice(-2, -1).flatMap(x => [x, endItem])).concat(this.slice(-1))
  14. }
  15. }
  16. Vue.config.productionTip = false
  17. new Vue({
  18. render: h => h(App)
  19. }).$mount('#app')