You have an example javascript implementation of a diff algorithm.
Based:
P. Heckel, Method for Isolating Differences between
Comm Files . ACM, 21, (4), 264-268 (1978).
The implementation itself has two functions, one of which is recommended for use:
diffString( String oldFile, String newFile )
This method takes two lines and calculates the differences in each. The end result is a "newFile" marked with HTML (for designation and deletion from oldFile and additions to newFile).
source
share