DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

JavaScript Array Methods # 14

// Array Methods
let num = [1, 2, 3, 34, 4]
let b = num.toString() // b is string now
console.log(b,typeof b)
let c = num.join("_")
console.log(c,typeof c)
num.pop()
console.log(num)
// let r = num.pop()// pop return the poped element
// console.log(num, r)
// let r = num.push(69)// push return the new array length
// console.log(num, r)
// let r = num.shift()// Remove an element from the start arry
// console.log(r, num)
let r = num.unshift(69)// Remove an element from the start arry
console.log(r, num)

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more