Announcement

Collapse
No announcement yet.

Front-End Javascript question (no espocrm)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Front-End Javascript question (no espocrm)

    Hi,
    what do that mean ?

    PHP Code:
    attributes['assignedUserId'] = [model.get('assignedUserId')]
    attributes['assignedUserName'] = [model.get('assignedUserName')]​ 
    Ok : atttibutes is a array

    Not understand = [ .... ] , why model.get('assignedUserId') is under 2 bracket ?
    and why not ; at the end of line ?

    Why not :
    attributes['assignedUserId'] = model.get('assignedUserId') \*with at end*\ ;

    Just for my knowledge.




  • #2
    This is the same as:

    Code:
    const list = [];
    list.push(model.get('assignedUserId'));
    attributes['assignedUserId'] = list;
    But the code snipped does not make sense in the Espo context. As assignedUserId is always string or null, not an array.

    Semicolon is not mandatory is javascript.
    Last edited by yuri; 11-22-2023, 11:45 AM.

    Comment

    Working...
    X