最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Join function in knockout js observableArray? - Stack Overflow

programmeradmin0浏览0评论

Is there a way to perform the javascript join function in a observableArray?

In javascript i can do the following:

var a = ["1", "2", "3"];

var p = a.join(',');  

and p would be "1,2,3" but with knockout i cant found a way to do this action?

Is there a way to perform the javascript join function in a observableArray?

In javascript i can do the following:

var a = ["1", "2", "3"];

var p = a.join(',');  

and p would be "1,2,3" but with knockout i cant found a way to do this action?

Share Improve this question asked Jun 26, 2013 at 14:39 Phoenix_uyPhoenix_uy 3,30410 gold badges59 silver badges106 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7
var x = ko.observableArray(["1", "2", "3"]);

var p = x().join(',');
发布评论

评论列表(0)

  1. 暂无评论