Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var obj = {
- "company": {
- "department_1": {
- "Products": {
- "unique_keyname_1": {
- "product_owner": "co-worker-1",
- "update_time": "unix_timestamp_1"
- },
- "unique_keyname_5": {
- "product_owner": "co-worker-4",
- "update_time": "unix_timestamp_45"
- },
- "unique_keyname_8": {
- "product_owner": "co-worker-2",
- "update_time": "unix_timestamp_5"
- }
- }
- },
- "department_2": {
- "Products": {
- "unique_keyname_3": {
- "product_owner": "co-worker-1",
- "update_time": "unix_timestamp_21"
- },
- "unique_keyname_6": {
- "product_owner": "co-worker-2",
- "update_time": "unix_timestamp_7"
- },
- "unique_keyname_4": {
- "product_owner": "co-worker-3",
- "update_time": "unix_timestamp_75"
- }
- }
- }
- }
- }
- obj.company.department_1.Products.unique_keyname_1
- obj["company"]["department_1"]["Products"]["unique_keyname_1"]
- // can also be more dynamic as:
- obj["company"]["department_"+ department_counter]["Products"]["unique_keyname_" + keyname_counter]
- var products = [
- {
- department: 'deparetment_1',
- productName: 'Something',
- productOwner: 'Someone',
- update_time: 'Sometime'
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement