Node red Uncaught TypeError: Cannot read property 'substring' of undefined

在node red 写如下函数,一直都出现错误

str=msg.playload;
msg.playload=str.substring(5,9);
return msg;

 

解释:函数名用错,msg.playload;应该为msg.payload, 这样才能返回一个string的str. 下一步才能截取str的5-9位的字符串。因为写错了函数,str根本就编译不了,不知上一个函数返回的是什么东西。

 

你可能感兴趣的:(Node red Uncaught TypeError: Cannot read property 'substring' of undefined)