skip to Main Content

Javascript – Access Object value in a string and compare

var siteList = {}; var siteInfo = []; var part_str = '[{"part":"00000PD","partSupplier":"DELL"}]'; var part = part_str.substring(1,part_str.length-1); eval('var partobj='+part ); console.log(partobj.part); console.log(partobj.partSupplier); The above code works fine. But I have to find out if the part number matches the following part;…

VIEW QUESTION

Get array validation key in laravel

Im using laravel 8.83.27 public function messages() { return [ 'price_per_image.array' => 'Price must be an array', 'price_per_image.required' => 'Price per image field is required', 'price_per_image.*.required' => 'Price per image '.preg_replace('/^[a-zA-Z_]*./', '', ':key').' field required', 'price_per_image.*.numeric' => 'You have invalid…

VIEW QUESTION

Javascript adding to an array

I have an object like this, that contains a lot more data than what is present but this is just a small sample. I am iterating through the object and checking if EmployeeLocations = object. If it does, I would…

VIEW QUESTION
Back To Top
Search