JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="text1" value='first' name="text[]"> <input type="text" value='second' id="text2" name="text[]"> <input value='third' type="text" id="text3" name="text[]">

JavaScript

$(function() {
    var values = $('input[name="text[]"]').map(function() {
        return this.value
    }).get()
    console.log(values)
})