<div class="js-input">
<input type="hidden" name="params[123][name]" value="Название">
<input type="hidden" name="params[123][id]" value="1">
<input type="hidden" name="params[221][name]" value="Название 2">
<input type="hidden" name="iparams[221][id]" value="3">
</div>
<script>
var data = {};
$('.js-input').find("input[name^='params[']").each(function() {
var match = this.name.match(/^params\[(\d+)]\[(.+)]$/);
data[match[1]] = {};
data[match[1]][match[2]] = this.value;
});
console.log(data);
</script>
const data = Array
.from(document.querySelectorAll('.js-input input'))
.reduce((acc, n) => {
const keys = n.name.match(/(?<=\[)\w+(?=\])/g);
const key = keys.pop();
keys.reduce((p, c) => p[c] = p[c] || {}, acc)[key] = n.value;
return acc;
}, {});
const data = {};
const $inputs = $('.js-input input[name^=params]:nth-child(odd)');
$inputs.each(function() {
const $first = $(this);
const $second = $first.next();
const regexp = /\[(\d+)\]\[(.+?)\]/;
const [, value, name] = $first.attr('name').match(regexp);
const [,, id] = $second.attr('name').match(regexp);
data[value] = {
[name]: $first.val(),
[id]: $second.val()
};
});