값에 null 값이 포함되어 있기 때문에 Javascrpit에서 배열이 문자열로 인식 된 경우
무엇을 하려고 했는가.
html의 데이터 속성에 포함된 배열을 jQuery의 data() 메소드로 가져오고 console.log로 표시.
아래 코드
word.js
var words = $(".word__wrapper").data('word');
console.log(words);
console.log(words[index]);
index.html.erb
<div class="word__wrapper" data-word='<%= @words.pluck(:id, :face, :image, :flip) %>'>
</div>
문제
2대의 맥으로 똑같은 코드를 달리게 했지만, 한쪽은 배열형으로서 취득할 수 있고, 한쪽은 문자열로서 인식되었다.
배열형으로서 인식되었을 때의 data 속성의 내용

문자열로 인식되었을 때의 data 속성의 내용

결론
캐릭터 라인으로서 인식되었을 때에 사용하고 있던 PC의 데이타베이스에 있어서, image 컬럼의 디폴트치가 NULL가 되어 있었다.
그것이 이유로 왜 배열로 인식하지 못했습니다.
해결책

↓

이상으로 배열형으로서 인식되었다.
Reference
이 문제에 관하여(값에 null 값이 포함되어 있기 때문에 Javascrpit에서 배열이 문자열로 인식 된 경우), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/NateRive/items/41d14ad5a4bdd204f1d9텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)